ID, array( 'fields' => 'ids' ) ); if ( ! empty( $cats ) ) { $args['posts_per_page'] = 3; $args['post__not_in'] = array( $current_post->ID ); $args['category__in'] = $cats; $args['no_found_rows'] = true; $args['ignore_sticky_posts'] = true; $args['orderby'] = 'modified'; } $the_query = new WP_Query( $args ); if ( $the_query->have_posts() && ! empty( $args ) ) : ?>