“Child of” function of multiple categories
-
Hi! Maybe this is a silly question, but I’m trying to show only child categories.
I had success implementing a function given by @shabti
function my_taxonomy_query( $args, $field, $post_id ) { // modify args $args['child_of'] = '2144'; //my category ID // return return $args; } add_filter('acf/fields/taxonomy/query/name={$field_name}', 'my_taxonomy_query', 10, 3);
But I would like to list other categories childs in the same field, not just one.
I tried things like
$args['child_of'] = array(2144,2145);
or
$args['child_of'] = '2145' , '2144';
but did not work.
Any suggestions?
Thanks in advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘“Child of” function of multiple categories’ is closed to new replies.