• Resolved tommls

    (@tommls)


    I’m working on a WooCommerce theme etc. but this question is quite general.

    I need only the post pages to have certain styles applied to them.
    The styles are defined in the child style css flle.

    What is the correct WP way to have specific styles applied only when a post page is being displayed??

    It could be WP coding or jQuery coding??

    Thank you, Tom

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter tommls

    (@tommls)

    The reason I am asking this is that the WooCommerce pages are getting styled by the child theme css, and I don’t want the WooCommerce pages to get the particular style being applied to make the blog/post pages display as I want them to…

    I need WP to look at if it’s a post type page and apply the styles but if WP knows a WooCommerce page is being requested then don’t apply the style.

    Most everything I’ve read is more generic than my request.

    I hope I’m making sense, I’m really quite new to VP…

    Thank you, Tom

    JenR

    (@jennifer-roberts)

    You should be able to use CSS selectors – i.e. page-specific or section-specific classes to do that – or make the broader change and then put in a more specific CSS rule for the Woo items – they have their own classes.

    Thread Starter tommls

    (@tommls)

    I already HAVE a child theme.
    Its css is being applied to all pages regardless of whether they are Woo pages or not.
    I’m asking how to have WP recognize the TYPE of page — post or archive — and apply specific styles to that — but NOT to the WooCommerce pages.
    Thank you, Tom

    Look in the output body tags – are there any classes in the pages you want to target that are not in the Woo pages?

    Thread Starter tommls

    (@tommls)

    Thank you, that would only take a few days. 🙂 🙂
    WC support suggested I should edit the templates themselves, I’ve asked for some clarification…
    But I’ll try that in the meantime.
    Thank you, Tom

    No, it should take less than five minutes – WP outputs various classes in the body tag – which would be consistent across ALL the same type of pages. If you post a link to the site, I’ll look at it.

    What theme are you using? If you are thinking about editing templates, you’ll need to be the theme-specific sub-forum.

    Thread Starter tommls

    (@tommls)

    WC support said to use

    remove_action( ‘storefront_loop_post’, ‘storefront_post_meta’, 20 );

    Removes it from all pages, no css needed.

    Thank you, Tom

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘apply specific style only to posts??’ is closed to new replies.