Home › Forums › General Issues › Custom Post Type Relationship Archive Page › Reply To: Custom Post Type Relationship Archive Page
Check out global $wp_query;
and than print_r( $wp_query );
… than you get the global object.
You also can use query vars and something like this:
<?php
$arguments = array(
'post_type' => 'artists',
'name' => get_query_var( 'name' )
);
$artists = new WP_Query( $arguments );
if( $artists->have_posts() ):
while( $artists->have_posts() ): $artists->the_post();
// your code
endwhile; wp_reset_postdata();
endif;
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.