WordPress.org

Ready to get started?Download WordPress

Forums

link to latest category post (4 posts)

  1. syncbox
    Member
    Posted 8 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:

    CATEGORY A
    excerpt from most current category A post
    read latest>>

    CATEGORY B
    excerpt from most current category B post
    read latest>>

    CATEGORY C
    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
    Member
    Posted 8 years ago #

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

    http://pastebin.com/563648

    (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.

    Emma

  3. moshu
    Member
    Posted 8 years ago #

    For what you'd like to achieve I'd suggest to take a look at this thread:
    http://wordpress.org/support/topic/38046?replies=31
    and apply the code from there to your blog.

  4. aylia
    Member
    Posted 8 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

Tags