Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

PetFile Query

// WP_Query arguments
$args = array (
	'post_type'              => array( 'pet-owner' ),
	'post_status'            => array( 'published', 'draft', 'pending', 'private' ),
	'category_name'          => 'pet-owner',
	'pagination'             => true,
	'posts_per_page'         => '5',
	'ignore_sticky_posts'    => false,
	'order'                  => 'DESC',
	'orderby'                => 'title',
	'perm'                   => 'edit_posts',
);

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

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

// Restore original Post Data
wp_reset_postdata();