'ids' ) ); // Bail if the term empty. if ( empty( $terms ) ) { return; } // Posts query arguments. $query = array( 'post__not_in' => array( get_the_ID() ), 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'id', 'terms' => $terms, 'operator' => 'IN' ) ), 'posts_per_page' => 10, 'post_type' => 'post', ); // Allow dev to filter the query. $args = apply_filters( 'blackvideo_related_posts_args', $query ); // The post query $related = new WP_Query( $args ); if ( $related->have_posts() ) : $i = 1; ?>
have_posts() ) : $related->the_post(); ?>
>