How can I retrieve the post by tags in New theme that is using another post_type
For example, I am building a cinema site..
The site is
For movies - I am using post - The movies are post there.. For actors - I am using post_type : persoane , Taxonomy : lista.
How can I retrieve the movies play by bruce willis in
This movie have Bruce Willis Tag....( this is a regular post in wp)
In Bruce Willis page I want to retrieve the movie.... that have Bruce Willis Tag
In conclusion I want to display the movies that actor play in
I anny body know please help.
Not sure but you can give it a try
$args = array(
'tax_query' => array(
array(
'taxonomy' => 'lista',
'field' => 'slug',
'terms' => get_query_var('term')
)
)
);
$query = new WP_Query( $args );
while ( $query->have_posts() ) : $query->the_post();
echo the_title().'<br />';
echo the_content();
endwhile;
wp_reset_postdata();