10, 'post__not_in' => [$post_id], 'orderby' => 'rand', 'post_type' => 'podcast', 'tax_query' => ['terms' => $tags], ]; // Get related posts $posts = new WP_Query($args); // Output results echo 'Related Setting: ' . $related_setting; echo 'Tags: '; print_r($tags); if($posts->have_posts()) { while($posts->have_posts()) { $posts->the_post(); echo get_the_title(); $post_tags = get_the_terms(get_the_ID(), 'post_tag'); echo 'Tags: '; print_r($post_tags); } } else { echo 'No related posts found'; } wp_reset_postdata();