$args = array(
'post_type' => 'post', // enter your post type
'orderby' => 'date',
'order' => 'DESC',
'posts_per_page'=> '-1', // show all posts
);
$loop = new WP_Query( $args );
if( $loop->have_posts() ):
while( $loop->have_posts() ): $loop->the_post(); global $post;
// DO SOMETHING
endwhile;
endif;
Author: Wojciech Borowicz
I hope this post will help you to do what you need.
In case you want some assistance click here to get in touch