I've been searching on this topic for 1 hour but I just can't seem to figure it out!
Im using this WP_Query to loop trough related posts and create clickable links:
<?php $currentID = get_the_ID(); $args = array( 'post_type' => 'nieuws', 'orderby' => 'date', 'post__not_in' => array($currentID), 'nieuwssoort' => current$term->slug, 'posts_per_page' => '7', ); $the_query = new WP_Query( $args ); ?> <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
everything works great but I need to show post with the corresponding taxonomy term instead of all
my taxonomy is called
nieuwssoort and I need to dynamically fill in the term, I know I need to start with this probably:
$terms = get_the_terms( $post->ID, 'nieuwssoort' ), but just can't figure out the rest and how to include it in the
new WP_Query( $args ) arguments array so it will fill out the current posts's nieuwssoort term in
'nieuwssoort' => ''