WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] More tag not showing (5 posts)

  1. nakedape
    Member
    Posted 7 years ago #

    Hi guys,

    First of all, I apologise if this has been covered elsewhere. I have had a search through Support under everything I could think of, but I don't really know what I am looking for! I will gladly be redirected if someone knows of an identical thread. :)

    I'm not very php savvy... I'm learning slowly and surely, but I'm having some trouble with displaying the <--More--> tag when fetching the most recent post from my 'news' category (id=3) on my custom homepage template.

    Here is the relevant php:

    <?php $posts = get_posts( "category=3&numberposts=1" ); ?>
    <?php if( $posts ) : ?>
    <?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
      <div class="post">
    	<a href="<?php echo get_permalink($post->ID); ?>" ><?php echo $post->post_title; ?></a>
    	<?php the_content('Read the rest of this entry &raquo;'); ?>
      </div>
    <?php endforeach; ?>
    <?php endif; ?>

    Have I commited some kind of horrible faux pas?

    The most recent post from the category displays just fine, but appears to ignore the More tag. I've also tried replacing the_content with the_excerpt and using the Optional Excerpts section when authoring, and this actually does, although the "read more" link is not a link at all, and actually just says [...]

    Any help would be very much appreciated.

    Am running WP 2.1.2 and the only plugin I've installed is the iinclude plugin ("Improved Include Page").

    Cheers,

    John :)

  2. nakedape
    Member
    Posted 7 years ago #

    no hints?

  3. nakedape
    Member
    Posted 7 years ago #

    Dr. Mike? Anyone...?

    Is it just that the more tag is not designed to work in that sort of context?? I'm still stumped.

    Pleeeeease?

    :)

  4. rudolf45
    Member
    Posted 7 years ago #

    If your custom homepage is a Page then the "more" tag will not work on it - by design: Pages always should display the whole content, since there is no way to 'list' the Pages as you can do with posts in multiple posts view (aka index, archives).

  5. nakedape
    Member
    Posted 7 years ago #

    Thanks, that's the info I was after... brilliant!

Topic Closed

This topic has been closed to new replies.

About this Topic