ID ); if ( ! empty( $current_categories ) ) { foreach ( $current_categories as $current_cat ) { $current_category_ids[] = $current_cat->term_id; } } $qargs = array( 'posts_per_page' => 3, 'post__not_in' => array( $current_post->ID ), 'no_found_rows' => true, 'ignore_sticky_posts' => true, ); if ( ! empty( $current_category_ids ) ) { $qargs['category__in'] = $current_category_ids; } $the_query = new WP_Query( $qargs ); ?>