Forums

[resolved] Different post content in first post in category list than following posts (7 posts)

  1. carjackd
    Member
    Posted 10 months ago #

    I'd like to display the most recent 7 posts from multiple categories on the homepage and style the most recent post in each category differently. I currently have this working fine on my dev, but i'd like to show different post content in the most recent post and less in the subsequent posts.

    basically id like to say:

    if {
    this is the most recent post in category A, display the title, author, featured image and exerpt and style it like this
    }
    else {
    display just the title and style it like this.
    }

    Thanks for any help you can give!

  2. carjackd
    Member
    Posted 10 months ago #

    To clarify... it would be 7 posts from category "A" in one div, 7 posts from category "B" in another, 7 posts from category "C" in another and so on.

  3. alchymyth
    The Sweeper
    Posted 10 months ago #

    I currently have this working fine on my dev, but i'd like to show different post content in the most recent post and less in the subsequent posts.

    what code are you using for the loops?
    (please use the http://pastebin.com/ if the code is longer than 10 lines)

    you could use a counter for each loop, and on $count==1 style the post differently;

  4. carjackd
    Member
    Posted 10 months ago #

    Here's the link to category "A" code

    http://pastebin.com/1MTUb63N

    Thanks for the quick response!

  5. alchymyth
    The Sweeper
    Posted 10 months ago #

    http://pastebin.com/S0epdqFS

    might need refining on the html structure of the last 6 posts.

  6. carjackd
    Member
    Posted 10 months ago #

    oh wow... awesome - thanks so much!

  7. dave
    Member
    Posted 6 months ago #

    @alchymyth or anyone who knows,

    What is the way to display posts from whatever the current category is, rather than hard-coding an actual category name?

Reply

You must log in to post.

About this Topic