Forums

WordPress Loop - Styling specific posts (3 posts)

  1. Adam
    Member
    Posted 9 months 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
    Member
    Posted 9 months ago #

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

  3. Christine
    WP Yogi & Forum Moderator
    Posted 9 months ago #

    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.

Reply

You must log in to post.

About this Topic