WordPress.org

Ready to get started?Download WordPress

Forums

To give a post a different styling in the loop (2 posts)

  1. smoothie.vemund
    Member
    Posted 1 year ago #

    Hi!

    I'm making an online magazine. Check here for live preview of my blog. What I want to do, is give for exemple one post a border around, and another a grey background. I'm not talking about the single.php file, but the frontpage itself. Is there any way I can do this?

  2. Peter_L
    Member
    Posted 1 year ago #

    Just those 2 styles?

    You could use the css3 selectors :odd and :even.

    But you'll also need a fallback for other browsers that don't know css3. This fallback has to be using classes. There probably is a simple way of doing this using a wordpress filter but i'm not sure how.
    You might also use javascript to add .odd and .even classes but i would advise against that.

Topic Closed

This topic has been closed to new replies.

About this Topic