WordPress.org

Support

Support » How-To and Troubleshooting » Using the read more tag on certain pages only?

Using the read more tag on certain pages only?

  • Hey everyone,
    Essentially I have one static front page which shows the two most recent blog posts, and then a normal blog page which shows all the posts as usual.

    On the front page, I am only showing excerpts of the two posts, then I have used the read more tag to link the the rest like this:

    <?php the_content(‘<span class=”readmore”>Read more</span>’); ?>

    The problem is that on the blog page the posts now have readmore tags while I want them to show the whole post. Even if I hide the tags themselves, the rest of the post is still hidden.

    Any solutions? =D

Viewing 5 replies - 1 through 5 (of 5 total)
  • Michael

    @alchymyth

    Forum Moderator

    That’s the way I’ve done it on the front page, and that part is working fine. Still couldn’t find anything about removing it from other pages though.

    Are you checking to see whether or not it is the homepage? Why not check to see if it is the home page or front page of the site using this:

    <?php if(is_home() || is_front_page()) the_content(‘<span class=”readmore”>Read more</span>’); else
    <?php the_content(”); ?> ?>

    Michael

    @alchymyth

    Forum Moderator

    on the blog page the posts now have readmore tags while I want them to show the whole post

    try and apply the method from the linked codex chapter to the blog page template.

    Thanks guys, it’s fixed now.

    For anyone else wondering, I just added:
    <?php global $more; $more = true; ?>
    to the blog page, which I believe is what alchymyth said to do =)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using the read more tag on certain pages only?’ is closed to new replies.
Skip to toolbar