Answer the question
In order to leave comments, you need to log in
What is the correct way to get data in Wordpress from a relationship?
Can someone please explain how to get data in wordpress.
For example, there are post types POST_TYPE1 and POST_TYPE2 registered in functions.
Through the ACF, the FIELD1 field is bound to POST_TYPE1, and the FIELD2 field is bound to POST_TYPE2 in the relationship with POST_TYPE1.
I'm doing a taxonomy POST_TYPE2 selection, but how do I get the FIELD1 value from the bound POST_TYPE1 ?
$args = array(
'post_type' => 'POST_TYPE2',
'tax1' => 'tax_val1'
);
$arrRes = new WP_Query( $args );
while ( $arrRes->have_posts() ) :
$arrRes->the_post();
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question