term_id; } } $args = array( 'post_type' => 'post', 'posts_per_page' => $relate_count, 'post__not_in' => array( get_the_ID() ), 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'category', 'field' => 'id', 'terms' => $termids, 'operator' => 'IN' ) ) ); $relates = new WP_Query($args); if ($relates->have_posts()): ?>