skip to Main Content

I am using the answer to Increase product price font size only on WooCommerce single product pages to change the product price font size for Woocommerce Product pages. However, it also changes the price font size on category pages, as well as for the Related Products block.

How can I change the product price font size on the product page only, and not other locations where prices are shown?

2

Answers


  1. You can do it simply from your style.css or your custom CSS.
    add class in your style.css and add font size etc… accordingly.

    One more thing, if want your CSS to apply only a specific page use body class as a prefix because few body classes are separate and apply page wise like page id, pos id, etc…

    How it works you should see this: https://www.awesomescreenshot.com/video/5127098?key=5298b9fb20a0e4c5288962b67f5bef1b

    Login or Signup to reply.
  2. As noted by m4n0 you can target the price on the single product page by using the body classes

    .woocommerce.single-product div.product p.price {
        color: #292929;
        font-size: 30px;
    }
    

    Note: you might need to use !important depending on your theme.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search