Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

news / posts

// WP_Query arguments
$args = array(
	'post_type'              => array( 'posts' ),
	'post_status'            => array( 'publish' ),
	'posts_per_page'         => '1',
	'ignore_sticky_posts'    => true,
	'order'                  => 'DESC',
	'orderby'                => 'date',
);

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

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

// Restore original Post Data
wp_reset_postdata();