Home › Forums › General Issues › Reverse query a post relationship on a taxonomy? › Reply To: Reverse query a post relationship on a taxonomy?
Sorry if I wasn’t clear, I know about the default WP behaviour and I need something different. This is how it is set up:
This Relationship field:
array ( 'key' => 'field_5231bd6773a84', 'label' => 'Product', 'name' => 'category_product', 'type' => 'relationship', 'return_format' => 'object', 'post_type' => array ( 0 => 'product', ), 'taxonomy' => array ( 0 => 'product_cat:3', ), 'filters' => array ( 0 => 'search', ), 'result_elements' => array ( 0 => 'post_type', 1 => 'post_title', ), 'max' => 1, )
Is attached to the default Categories:
'location' => array ( array ( array ( 'param' => 'ef_taxonomy', 'operator' => '==', 'value' => 'category', 'order_no' => 0, 'group_no' => 0, ), ), array ( array ( 'param' => 'ef_taxonomy', 'operator' => '==', 'value' => 'post_tag', 'order_no' => 0, 'group_no' => 1, ), ), )
My question is how to query the category on the product post type template.
Hope I was clear and thanks so much for your time!
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!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.