Home › Forums › ACF PRO › Categories parents in taxonamy › Reply To: Categories parents in taxonamy
I found this helping to select parent categories
function my_taxonomy_query( $args, $field, $post_id ) {
// modify args
$args['parent'] = 0;
// return
return $args;
}
add_filter('acf/fields/taxonomy/query', 'my_taxonomy_query', 10, 3);
Image example: http://prntscr.com/e5i7a7
I created another custom field to select the child category, but how would it work?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.