Site logo

Archived topic

Can I make CSS affect multiple blog posts?

7 replies · Started by Jennifer on March 8, 2017

Viewing posts 1–8 of 8

So, I'm overriding the blog layout settings on the customizer with some CSS for my actual blog posts (the blog layout settings affect Woocommerce, I know you understand this). Is there a way for me to write the CSS to cover all of my blog posts, or am I restricted to creating custom CSS for each post? (i.e., .postid-xxx)

Thanks again!

Jen

Hi Jen,

All of your blog posts meaning everything but WooCommerce products?

Hey Tom,

Right, my actual blog. The CSS used to affect my woocommerce pages are all fronted by .woocommerce, at any rate, and don't use .postid. I hope that makes sense; I don't really know proper terminology.

Thanks,

Jen

Hi Jen,

If it's the blog page that displays all the posts, you can use the selector .blog
If it's the blog posts then you can use .single

Let me know if this answers your question.

Since blog posts are shown on more than just the .blog (.archive, .category etc..), you could try this:

.blog,
.archive {
    /* CSS */
}

Alright, so I figured it out, taking OUT the .postid actually makes it apply to all those elements I'm trying to address. Sorry, this was probably an obvious solution for someone with web design know-how.

Thanks,

Jen

Oh, ha! Thanks Leo! My adaptation did work, but it ALSO affected the blog, adding the .single worked perfectly!

You guys are the bees knees!

Jen

Glad we could help :)

This archived topic is closed to new replies.