Get child categories of custom taxonomy
-
I have created a custom taxonomy which I can query for and get all the categories, parent and child, but I am wanting just the child elements. I used the below code to get the category ID,
get_cat_ID( $cat_name='Apps1' ); $cat = get_term_by( 'name', $cat_name, 'appCategory' ); echo $cat -> term_id;
This returned 50 which I included in my
$args
,$args = array( 'orderby' => 'id', 'show_count' => 0, 'use_desc_for_title' => 0, 'child_of' => 50, 'taxonomy' => 'appCategory' ); wp_list_categories($args);
I also tried removing the
taxonomy
tag but so far I am only able to get it to display built-in wordpress post/categories and nothing from my custom post/taxonomy. How can I display the child elements for a custom taxonomy parent?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get child categories of custom taxonomy’ is closed to new replies.