1 full post and excerpts for the rest on home page (5 posts)

  1. bigcityjohn
    Posted 7 years ago #

    I've tweaked and tweaked the coding of the site on which I'm working to where it's almost exactly what's needed. However, I can't quite figure out how to do this:

    On the home page I want the 5 most recent posts to show. The most recent post should be the full post in its entirety, and the remaining 4 posts should be excerpts. The link to previous posts beyond the 5 on the home page should also remain--and all additional paged pages should be excerpt only.

    I can't figure out how to make the query or proper bits of code to do this "1 full post/4 excerpts" combo. Of course, I can make all the posts show fully or all as excerpts...just can't figure out the combination that I need.

    Anyone know if this is do-able? If so, would you kindly show me the code to make the magic happen?

    Thanks in advance.

  2. buddha trance
    Posted 7 years ago #

  3. bigcityjohn
    Posted 7 years ago #

    Thanks for the link. That's exactly what I need, but I just want it on the front page/home page only. I tried out the code, and it carries over to the second page of posts and beyond, as well as other non-home page pages like category listings, etc.

    I'll have to play around, but I'm not very good with PHP and WP code at the moment.

  4. buddha trance
    Posted 7 years ago #

    That code should be for the front page only (index.php of your theme).
    From there, you click on the permalink and go to the individual post.

    You mention a second page of posts... did you set a number of posts to be displayed in your front page, in your admin settings? Right, I can see that happening now, when you go to earlier posts...

    Try setting up a static front page with the changed index.php, and then create a template called "blog", with the original index.php of your theme. To create the template, at the very top, put

    <?php /*
    	Template Name: Blog
    */ ?>

    create a page called Blog and select "blog" as the template.

    Then, in admin settings, select the front page to be static, and Blog for the posts. Maybe this will work better for you, and leave the blog part untouched.

  5. bigcityjohn
    Posted 7 years ago #

    Thanks for the further info. I'll give that a try later when I have a chance. I'll let you know what happens.

Topic Closed

This topic has been closed to new replies.

About this Topic