WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] More tag not trimming content (3 posts)

  1. room58
    Member
    Posted 8 years ago #

    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.

  2. iand
    Member
    Posted 8 years ago #

    My code is on a Page template

    The more tag is disabled for pages. A quick search pulls up this:
    http://wordpress.org/support/topic/60060

  3. room58
    Member
    Posted 8 years ago #

    Thanks Ian.

    Sorted.

Topic Closed

This topic has been closed to new replies.

About this Topic