Jump to content

Recommended Posts

Hi All,

 

In Wordpress, I want to add right in the beginning of the Post some Random and Custom Content (Which is in a separate file, one in each new Line).

 

In the same post, i want to add sentence (Again from a separate Text file) at the bottom of the Post.

 

To sum up, i want to add content from a separate TXT file in the beginning of the Post and at the end of the post.

 

How can this be achieved? Any Plugin? Any Coding, If yes, may some PHP Geek can code it out? I Would not mind to PAY.

 

P.S.: Am Stuck here, would you mind to hand me out of this technical Jungal?

 

Thanks and Regards

Natasha T.

Link to comment
https://forums.phpfreaks.com/topic/173324-how-can-this-be-done-in-wordpress/
Share on other sites

  • 2 months later...

in your page.php which has this code

 

<?php get_header() ?>
	<div id="content"><div id="content-in">
	<?php if (have_posts()) : ?>
		<?php while (have_posts()) : the_post(); ?>
		<div id="post-<?php the_ID(); ?>" class="post">
			<h3 class="title"><?php the_title(); ?></h3>
			<div class="meta clearfix">
				<span class="date-post">Posted on <?php the_time('F j Y') ?></span> <span class="author-post">by <?php the_author() ?></span>
			</div>
			<div class="entry">
				<?php the_content(''); ?>
			</div>
			<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
			<div class="clear"></div>
		</div>
		<?php endwhile; ?>
		<?php comments_template(); ?>
	<?php else: ?>
		<h2 class="center">Not Found</h2>
		<p class="center">Sorry, but you are looking for something that isn't here.</p>
	<?php endif ?>
<?php get_sidebar(); get_footer() ?>

 

You could clearly see

<?php the_content(''); ?>

 

Put what ever you want before and after that line.

 

I hope it will help.

If you're not stuck for time or at least when you do have the time I strongly recommend the following tutorial (below link). It will show you how to build a Wordpress theme from scratch. The benefit of this is that you'll know how to modify any template. PHP coding isn't required. If anything this tutorial will also teach you some of the basics of WordPress. I've studied and used it with great success.

 

http://www.wpdesigner.com/2007/02/19/so-you-want-to-create-wordpress-themes-huh/

 

Later gater.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.