Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Custom Post Type Query

Custom Post Type Query for published posts and ordered by menu order.

// WP_Query arguments
$args = array (
	'post_type'              => array( 'services' ),
	'post_status'            => array( 'publish' ),
	'nopaging'               => true,
	'order'                  => 'ASC',
	'orderby'                => 'menu_order',
);

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

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

// Restore original Post Data
wp_reset_postdata();