WordPress Loop - Styling specific posts (3 posts)

  1. Adam
    Posted 2 years ago #

    In the loop for the index post - How could I say - if post is sticky, aside or what ever do this. else do that.

  2. Andrew Bartel
    Posted 2 years ago #

    Check out Firebug. Use it to figure out which classes you need to style.

  3. You can use the post class. If you look at the html output, sticky posts have the following:

    <div id="post-188" class="post-188 post type-post status-publish format-standard sticky hentry category-aciform category-cat-a category-cat-b category-cat-c category-sub tag-tag1 tag-tag2 tag-tag3">

    The class sticky is in there, so you can use that in your css and make that different.
    Check out the twentyten theme and see how they did it.

Topic Closed

This topic has been closed to new replies.

About this Topic