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 ) ) : ?>

have_posts() ) : $the_query->the_post(); /* * Include the Post-Type-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Type name) and that will be used instead. */ get_template_part( 'template-parts/related-posts/content', 'single' ); endwhile; ?>