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!
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.