Add multiple classes. Different style for each category tag

In order to add an specific class to each category using the_category, you need to hack your code a little bit. It will output the same result, but with a class added to each item. The class name will be the category slug. In your functions.php: add_filter(‘wp_list_categories’, ‘add_slug_class_wp_list_categories’); function add_slug_class_wp_list_categories($list) { $cats = get_categories(‘hide_empty=0’); foreach($cats … Read more

wp_list_categories in in nav_menu

Something along these lines should at least get your started. You’ll need to register the menu first and get the ID. I didn’t get to deleting categories but you’ll need to take care of that as well. This is largely untested. Back up your DB first!! add_action( ‘created_category’, ‘my_update_category_menu’ ); add_action( ‘delete_category ‘, ‘my_delete_category_menu’ ); … Read more

WordPress category check

You want the function in_category(), not in_cat(). And to check multiple categories you need to pass an array as a single argument (as opposed to multiple arguments): if ( is_single() && in_category( array( 3, 5, 6 ) ) )