link to latest category post (4 posts)

  1. syncbox
    Posted 10 years ago #

    I am planning a home page where I want to display an excerpt (5-10) lines of the last (latest) post in each of 3 categories. eg:

    excerpt from most current category A post
    read latest>>

    excerpt from most current category B post
    read latest>>

    excerpt from most current category C post
    read latest>>

    I have more than 3 categories, but only want these 3 catefories to show an excerpt from their most current post.

    Ideas? I am fairly new to WP... though I can sort of read the intent of the default loop code.

    Would the way to go about this be to create a home.php page, dd the headings and (?) add code to pull the excerpt (5-10 lines) and link to latest post in each category of an ID? (that's my idea)

    What would be the code for an excerpt from and link to the latest post of category X?

    Any help appreciated, thanks!

  2. aylia
    Posted 10 years ago #

    The way I have done this is to use get_posts, as here:


    (used on my site http://www.nouse.co.uk in case you want an example.)

    you could create a new home.php for this, but personally I just changed the index file.

    Hope this helps.


  3. moshu
    Posted 10 years ago #

    For what you'd like to achieve I'd suggest to take a look at this thread:
    and apply the code from there to your blog.

  4. aylia
    Posted 10 years ago #

    I think that solution is very overcomplicated - as someone newish to WP myself I didn't understand how it was constructed and therefore how it could be modified to fit my own needs.

    But If you're going for other solutions, these plug-ins have also been suggested to me:

    Customizable post listings

    and a WP Category Posts Plugin

Topic Closed

This topic has been closed to new replies.

About this Topic