How to set up the read more feature on posts? (7 posts)

  1. mixmastermichael
    Posted 4 years ago #

    Hi there,

    I have a blog set up, but I need to have it so that the post only displays something like a couple paragraphs and then the "read more" comes in at the end of the post where readers can go to the single post.

    Can someone please explain how I might be able to implement this into my posts?


  2. Michael
    Forum Moderator
    Posted 4 years ago #

    use the 'more tag' when writing your posts, and the_content('read more'); in the template;
    use the_excerpt(); in the template: http://codex.wordpress.org/Function_Reference/the_excerpt

  3. alex27
    Posted 4 years ago #

    Also, please note that if you decide to use the_excerpt(); by default there will be no 'more' link. However there's a way to achieve that - look in the first link provided by alchmyth.

  4. mixmastermichael
    Posted 4 years ago #

    Thanks for the replies guys, hmm - neither of those seem to be working though. The way my code is set up now, it looks like there is something that tries to have the "read more" feature set up but it doesn't work. Removing this code removes the .entry completely though...

    <?php the_content('Read the rest of this entry »'); ?>

    So I mean is there a way that this should be working otherwise?? Don't really know what is going on so that the "read this entry" part comes in.

    Any help would be greatly appreciated.

  5. Michael
    Forum Moderator
    Posted 4 years ago #

    Removing this code removes the .entry completely though...

    have you tried to replace the code with:

    <?php the_excerpt(); ?>

    also, should you be using the code in a page template, you need to apply:

  6. mixmastermichael
    Posted 4 years ago #

    Ah, getting closer, thanks for the reply. So, replacing that code with
    <?php the_excerpt(); ?>

    Condenses the code, and puts a [...] at the end, but it doesn't actually provide a link in there to the single post like I would like it too... any ideas how I can do that??

    Err, actually, putting that code above works, but I need the facebook and twitter stuff to show up on the posts on the blog page which it doesn't do when I use that code.

    oh, here's the URL - http://www.moko.com.php5-21.websitetestlink.com/?page_id=217

    Help please? Sort of driving me nuts and after I figure this out I am like 90% done with the site!

  7. mixmastermichael
    Posted 4 years ago #

    Nevermind guys, thanks for the help. Figured this out, should have read the first link more closely, had to paste that into the functions.php file.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.