I have next code and i cant get it to list only the subcategories of a category and not sub-subcategories of the category.
I think the problem is the next line
'hierarchical' => 0,
Do you know what can be the problem or what should i add in the next code to fix for what i want.
I've set it to 1 to 0, and nothing changes. This is a custom theme for a directory.
<?php // Get variables
global $def_cat_style;
$get_id_parent_cat = get_term_by( 'slug', $company_category, 'company_category' );
$args = array(
'child_of' => $get_id_parent_cat->term_id ,
'parent' => get_query_var(''),
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 0,
'hierarchical' => 0,
'taxonomy' => 'company_category',
'pad_counts' => true );
$categories = get_categories($args);
?>
Thank you.
'hierarchical'
to 3? – 5ervant Aug 5 '15 at 14:38'depth' => 2
. – 5ervant Aug 6 '15 at 9:06