Trying to highlight custom taxonomy pages in the main nav, so I am trying to get the post_type
of the current rendered page (to compare to the menu item):
add_filter('nav_menu_css_class', 'current_tax_nav_class', 10, 2);
function current_tax_nav_class($classes, $item) {
$post_type = get_query_var('post_type');
echo ">>>";
print_r( $post_type );
echo "<<<";
return $classes;
}
But cannot get post_type var to return anything. This code is in functions.php
Using WP Version 4.4.1