A
A
Alexander Sinitsyn2015-12-14 11:20:11
WordPress
Alexander Sinitsyn, 2015-12-14 11:20:11

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

1 answer(s)
L
litvin2, 2015-12-16
@litvin2

Can you explain?
Or better yet, with the real names of fields and records, so that the essence of the stored data is clear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question