WordPress.org

Ready to get started?Download WordPress

Forums

css style certain posts (3 posts)

  1. raptrex
    Member
    Posted 8 years ago #

    basically i wanted to style my first post to be in the center
    and have the rest on the left side.

    http://troidus.com/article/6
    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?

  2. Doodlebee
    Member
    Posted 8 years ago #

    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 :)

  3. theiconoclast31
    Member
    Posted 8 years ago #

    http://www.urbangiraffe.com/2005/05/20/themeguide4/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:

    http://codex.wordpress.org/Template_Tags

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags