More tag not trimming content
-
I wish to display a ‘Read more here’ at the end of a list of a posts. My code is on a Page template which is as follows
<?php get_header(); ?>
<div id="content_holder">
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; endif; ?>
<?php
$posts = get_posts('numberposts=5');
foreach($posts as $post) :
setup_postdata($post);
?>
<h3><a href="<?php the_permalink(); ?>" class="post"><?php the_title(); ?></a></h3><?php the_content(); ?>
<?php endforeach; ?>
</div>
</div>
<?php get_footer(); ?>I have put the more tag into my posts where I wish to terminate the code but it’s not terminating the rest of the post content. It is displaying all of the content. I have seen the_exerpt_reloaded() which I have installed but what I’m doing should be that complicated. Can anyone see why it’s not working? If I use excerpt() I get my content trimmed.
- The topic ‘More tag not trimming content’ is closed to new replies.