Add a CSS class to WooCommerce Shop Page

Woocommerce Add Css Shop Page

Using the filter body_class with the is_shop conditional you can target the main WooCommerce shop page by adding a CSS class. add_filter( ‘body_class’, ‘woo_shop_class’ ); // Add WooCommerce Shop Page CSS Class function woo_shop_class( $classes ) { if ( is_shop() ) // Set conditional $classes[] = ‘woo-shop’; // Add Class return $classes; } The above…

Read More

Add Modern Tribe Event Categories as CSS classes in Event Posts

Modern Tribe Event Category

Event Categories are not added as CSS classes to individual Event Posts in the Modern Tribes Event Plugin for WordPress,  however you can use the body_class filter to add them in. add_filter( ‘body_class’, ‘cp_event_taxonomy_in_body_class’ ); // Ref – https://theeventscalendar.com/support/forums/topic/add-category-name-as-body_class/ // Add event categories terms to body class of event posts function cp_event_taxonomy_in_body_class( $classes ){ global…

Read More