Custom Taxonomy – Modify Function to Get Child Category
if it is for product categories, this function only needs the category id to know the childrens: function cat_childs( $term_id = 0) { $children = get_terms( array( ‘child_of’ => $term_id, ‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => true, ‘fields’ => ‘ids’, )); return ( $children ); } can be called like this: cat_childs(1234); because it can return … Read more