WordPress WP_Query() Loop Retrieve latest 10 posts


Example

$args = array(
    'post_type'=>'post',
    'posts_per_page' =>'10'
);
$latest_posts_query = new WP_Query( $args );
if($latest_posts_query->have_posts()) :
while ( $latest_posts_query-> have_posts()) : $latest_posts_query->the_post();
//Get post details here
endwhile;
endif;