Need to access sub-sub categories. So, I get the categories:
$terms = array(); $terms = get_categories(array('orderby' => 'name', 'hide_empty' => 0,'taxonomy' => 'category','parent' => 0)); if( ! $terms ) return null; if($first) { return $terms[0]->term_id; } So I get all the subcategories:
$parrent_id = array(); $parrent_id = get_categories( ); foreach ($parrent_id as $value) { $sub_parent_id = $value->parent; if($sub_parent_id > 0){ $sub_parent_id = $value->term_id; } } How to get subcategories to these sub-categories that the script has received above?