Support » Fixing WordPress » Style top-most post differently

  • 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!

Viewing 5 replies - 1 through 5 (of 5 total)
  • you need to count the loop throughs.

    Thread Starter alamba78

    (@alamba78)

    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.

    Thread Starter alamba78

    (@alamba78)

    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.

    Thread Starter alamba78

    (@alamba78)

    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?

    Conceptually, and actually. 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Style top-most post differently’ is closed to new replies.