Add category name to single advert page body class
-
Hi there,
I have managed to add the advert category to the listings body class using the following code
function add_category_name($classes = '') { $category_id = get_queried_object_id(); $category = get_term( $category_id ); $classes[] = 'category-'.$category->slug; return $classes; } add_filter('body_class','add_category_name');
But it doesn’t work on single ad pages – can anyone help?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add category name to single advert page body class’ is closed to new replies.