Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

WP_Query to List All Posts

// WP_Query arguments
$args = array(
	'post_type'              => array( 'Post' ),
	'post_status'            => array( 'any' ),
	'nopaging'               => false,
	'ignore_sticky_posts'    => false,
	'order'                  => 'ASC',
	'orderby'                => 'title',
	'cache_results'          => true,
	'update_post_meta_cache' => true,
	'update_post_term_cache' => true,
);

// The Query
$wdev_post_query = new WP_Query( $args );

// The Loop
if ( $wdev_post_query->have_posts() ) {
	while ( $wdev_post_query->have_posts() ) {
		$wdev_post_query->the_post();
		// do something
	}
} else {
	// no posts found
}

// Restore original Post Data
wp_reset_postdata();