Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Employees Loop Query

Employees Custom Post Loop Query

// WP_Query arguments
$args = array (
	'post_name'              => 'employee',
	'pagination'             => true,
	'posts_per_page'         => '10',
	'posts_per_archive_page' => '10',
	'order'                  => 'ASC',
	'orderby'                => 'title',
);

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

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

// Restore original Post Data
wp_reset_postdata();