CSS styling common on all blog posts

  • Unknown's avatar

    Hi, I’m using ‘Purpose’ theme. I want to style all my posts the same: is there some css I can use to do this or do I have to treat each new post as a new post to style – e.g., do I have to use .post-id-xxxx for each new post to style them the same or is there a shorthand I can use? I’ve tried doing the .post-id-xxxx for the relevant page, but it’s not working either! Any ideas? (Fairly new to CSS and figuring things out so not too complicated, please!)

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there,

    Each post in WordPress will have several classes.

    Usually one of these classes will be unique, like “.post-116” (a post with a id number of 116), and some will be fairly generic, like “.post” (all blog posts will have this class, but not the pages or widgets).

    In your case, because you want to target all posts, you will need “.post”.

    .post {
    	background: #123456;
    }

    I hope this helps!

    Best regards,

    Michael

  • Unknown's avatar

    Thanks Michael – for some reason this hasn't worked…I'll need to fiddle about with it to see why not.

    Diane

  • Unknown's avatar

    Diane, can you point me to a post with the styling you want? Are you wanting the same styling on all posts, or do you have different styling you want to apply to different posts?

  • Unknown's avatar

    Also, are you talking about posts or pages?

  • Unknown's avatar

    Hi,

    Posts. I've got a static front page, and I want my first post to have a slightly different styling, but all subsequent posts to have the same styling as on the rest of the site, but they've reverted to the built-in theme styling.

    Diane

  • Unknown's avatar

    Diane, can you identify the section on the main page you want to style differently? Is it the section with the bird and We help you… / We design and deliver… ?

    I’m not seeing any posts in the Featured News section, and do not see that you have a category set for that at Customize > Theme. Are you talking about the Featured News section?

    Sorry, I’m still a bit confused as to which section of your main page you are wanting to change the styling on.

  • The topic ‘CSS styling common on all blog posts’ is closed to new replies.