Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

query public call

// WP_Query arguments
$args = array(
	'post_type'              => array( 'event' ),
);

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

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

// Restore original Post Data
wp_reset_postdata();