How to get a custom taxonomy slug in body classes
To add the custom taxonomy slug to the body classes of your WordPress site, you can use the body_class filter along with your custom code. Below is your example of how you can achieve this: function themeprefix_add_taxonomy_class($classes) { global $post; if (is_page()) { $taxonomy = ‘page_section’; $terms = get_the_terms($post->ID, $taxonomy); if ($terms && !is_wp_error($terms)) { … Read more