Forums

Style top-most post differently (6 posts)

  1. alamba78
    Member
    Posted 7 years ago #

    How can I style the top-most post differently from the rest? I would like to add a nice background and contain the first post as a "featured post". But, since the generation of the posts is dynamic, I'm sure some hacking of the post loop will be necessary. To accomplish this, would I need to keep track of a post counter or use the post_ID function??? Any insight into this would be really appreciated! Thanks!

  2. charle97
    Member
    Posted 7 years ago #

    you need to count the loop throughs.

  3. alamba78
    Member
    Posted 7 years ago #

    Charle97, or anyone for that matter, doesn't the 'if ($counter > "2") { break };' code need to be within php tags?? This code snippet is from the link charle97 provided. It is in skippy's response to raena.

  4. alamba78
    Member
    Posted 7 years ago #

    Nevermind about my last post(s). The concept is what I needed. But, now that I can separate posts by a counter value, how can I style that particular post div?? I guess I should think about it some more b4 I ask, but I'd like any other ideas aside from my own. Thanks.

  5. alamba78
    Member
    Posted 7 years ago #

    Ok, I noticed in the index.php file that each post already gets a div of value post. I can't for the life of me find where it's getting that <div id="post"> from. Or maybe I can just wrap an extra div around the first post via a counter and then just style that. Redundant use of divs, but it conceptually may work right?

  6. Kafkaesqui
    Moderator
    Posted 7 years ago #

    Conceptually, and actually. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.