Hello,
This is more of a WordPress issue but I hope you can help.
I am using a Custom Looper. My goal is to show sub-category (child category) names of the main category, called “Content Type”.
My custom looper looks like this…
and I have the below code in function.php:
add_filter( 'cs_looper_custom_my_data', function( $result ) {
$subcats=get_categories(array('child_of' => 47, 'taxonomy'=>'category', 'hide_empty'=>0));
return $subcats;
});
For some strange reason, if I remove 'child_of'=>47
the loop will return all categories, parent and child. But when I insert that clause, it gives me a blank. The Category ID is 47 (as shown in the above image). I just cannot figure out what’s wrong.
Any clues?
Many thanks in advance.