Apply a custom taxonomy to wp_list_categories
-
This function lists all the child categories for the current parent category/archive. For the life of me I can’t see why this isn’t working for custom taxonomies. It works fine like this (normal categories).
<?php if (is_category()) { $cur_cat = get_query_var('cat'); if ($cur_cat) { $new_cats = wp_list_categories('show_option_none=&echo=false&child_of=' . $cur_cat . '&depth=1&title_li=&show_count=1&hide_empty=1'); echo '' . $new_cats . ''; } } ?>
But it doesn’t work like this with a custom taxonomy…
<?php if (is_taxonomy()) { $cur_catp = get_query_var('catp'); if ($cur_catp) { $new_catsp = wp_list_categories('show_option_none=&echo=false&child_of=' . $cur_catp . '&depth=1&title_li=&show_count=1&hide_empty=1&taxonomy=p_scales'); echo '' . $new_catsp . ''; } } ?>
I need both to work side by side hence why i’ve changed the variables.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Apply a custom taxonomy to wp_list_categories’ is closed to new replies.