• Resolved juanp

    (@juanp)


    How can I apply css rules for custom taxonomies?

    I have created a custom taxonomy to classify products that are for men, women and children. I would like to have different styles on the archive pages of each of these taxonomies.

    Thank you in advance who can guide me

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    At minimum, I would check your browser inspector tools and whatnot to inspect what custom classes may or may not be on your <body> tag. If the theme is decent, they probably have a body_class() function call on the tag that produces dynamic classes and output dependent on what you’re viewing. This would include taxonomy/term data that you can use to selectively style based on the current view.

    Thread Starter juanp

    (@juanp)

    Thank you very much Michael,

    I think I found what you mentioned:

    <body class=”archive tax-linea term-teens term-111 logged-in admin-bar wp-embed-responsive woocommerce woocommerce-page woocommerce-js list-view shop-full-width wpb-js-composer js-comp-ver-5.7 vc_responsive customize-support”>

    (screenshoot: https://prnt.sc/or2bau)

    Would you be so kind as to tell me how I should write it on the style sheet?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    each of those are an individual class that you can use in CSS like this:

    .tax-linea {
       color: red;
    }
    

    if you wanted linea terms to have red text. The rest is going to be pretty much up to you.

    Thread Starter juanp

    (@juanp)

    Thank you very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CSS for custom taxonomies’ is closed to new replies.