Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Events

// WP_Query arguments
$args = array(
	'post_type'              => array( 'school_events' ),
	'order'                  => 'DESC',
	'orderby'                => 'date',
);

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

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

// Restore original Post Data
wp_reset_postdata();