In my theme's file single.php, there is this part of code to get Related Videos:
<?php
if ( $wp_query ->have_posts() ) {
while (have_posts()) : the_post();
get_template_part( 'preview', get_post_format() );
endwhile;
}
wp_reset_postdata();
?>
But this get the entire loop of all posts on the website. I'm wondering, is there a way to limit this and display for example 10 posts? Thanks a lot.