Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

query

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

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

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

// Restore original Post Data
wp_reset_postdata();