Support » Themes and Templates » Customizing the first Post

  • I want to customize the first post on my blog to look differntly than the others. Basically I need to pull the first post from the loop apply some type of “What’ new” styling and then proceed with displaying the remainder of the loop. Any ideas? This would be on the home page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Add a type of counter, something that has been discussed quite often here for comments and posts. Set a variable to true before the loop and at the end set it to false, then test for the variable and display the necessary styling. The first time it is true and then all other loops it is false.

    If you look for some of my initial posts about placing adsense ads between posts (like CG-Inbetween now does), Beel is right, there’s a bunch of code samples for how to set a counter and do something special before/after/around a given post.

    all you need to do for the first post is set a flag outside the loop to true, clear it after each post (redundant but easier), and where the post div is output also insert id=”firstpost” or something like that.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customizing the first Post’ is closed to new replies.