Kambro
Kambro

Reputation: 29

How to apply CSS to the Wordpress blog post pages without changing product pages of Woocommerce?

Good morning,

I would like to modify the CSS of my blog post pages, but if I do it, that change also the Woocommerce product pages description text, because both are identified as being "p".

p, ul, ol, pre, h1, h2, h3, h4, h5, h6, table, form {
    margin-bottom: 20
px
;
    line-height: 1.786em;
    font-size: 16px;
    color: #2f2b35;
}

Example of page where I like to change the text: https://librairiedamase.com/blog/quelle-bible-choisir/

Example of page where I like not to change the text (of description): https://librairiedamase.com/boutique/sainte-ecriture/bible-expliquee-et-commentaires/commentaire-des-psaumes-2/

Thank you in advance.

Upvotes: 0

Views: 71

Answers (2)

Ash0ur
Ash0ur

Reputation: 1545

You need to prepend a single post body class before your target tags.

Example:

body.single-post p {
  margin-bottom: 20px;
  line-height: 1.786em;
  font-size: 16px;
  color: #2f2b35;}

Upvotes: 1

John
John

Reputation: 5335

Try adding this to your css

#content > .entry > * {
    margin-bottom: 20px;
    line-height: 1.786em;
    font-size: 16px;
    color: #2f2b35;
}

Upvotes: 1

Related Questions