I have many categories of this type:
Category 1> Subcategory 1> Subcategory 1
Category 2> Subcategory 1> Subcategory 1
How can I get an array with the ID of subcategories only? I tried to specify parent = 0, but then just because I only have Parental main categories and displays.
$categories = get_terms( 'category', array('order'=> 'DESC', 'fields' => 'ids', 'hide_empty' => 1) ); foreach($categories as $category) { echo $category->term_id; }