Can somebody come up with something clever on how to add a custom body class or a class to a specific wrapper div from the woocommerce product category page?
I have thought of using the category description, but it dosent look like a nice solution. I want it just to generate two classes, either “light” or “dark”.
Anyone??
Kind regards,
Ricahrd
Are you echo’ing body classes? If so, have you tried hooking in to the body_class-function in WordPress? (https://codex.wordpress.org/Plugin_API/Filter_Reference/body_class)
something like:
PHP Snippet: Add WooCommerce Product Category as Body CSS Class
You can place PHP snippets at the bottom of your child theme functions.php file (before “?>” if you have it). CSS, on the other hand, goes in your child theme style.css file.