Support » Themes and Templates » css style certain posts

  • basically i wanted to style my first post to be in the center
    and have the rest on the left side.
    if i used this article, its only to add something after the first post right?

    thats not what im looking for

    can someone help with what i want?

Viewing 2 replies - 1 through 2 (of 2 total)
  • No – you could totally use that code to do what you wanted to. Basically where it says “Do special post stuff here”, replace that with how you want your post to be displayed. For example, put it in a containing div with a unique ID. Then have the rest of them with your normal template code.

    Use your CSS to define what happens with the “special post” id – it’s actually pretty simple using that tutorial 🙂

    Dissection of a WordPress theme: Part 4

    The above link introduces you to the ‘loop’, which is the basic method that WordPress uses to display posts. Inside the ‘loop,’ you can use a number of ‘template tags’ to display the post information that you’d like. The Codex has a list of ‘template tags’ you can use:

    The link in your post places the first post in a special loop, and then makes a second loop for the rest of the posts. If you add a special CSS class to the first loop, you can center it in your stylesheet accordingly.

    Good luck.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘css style certain posts’ is closed to new replies.