Last active
October 10, 2018 20:20
-
-
Save isaacdanielanderson/fb97f1bcca4ddbd0ecccf167f98a74ea to your computer and use it in GitHub Desktop.
Query in specific custom post type with a custom query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$servicesCpt = new WP_Query(array( | |
'posts_per_page' => -1, | |
'post_type' => 'teamMembers', | |
'orderby' => 'title', | |
'order' => 'DESC' | |
) | |
); | |
if ($servicesCpt->have_posts()) { ?> | |
<?php | |
while($servicesCpt->have_posts()) { | |
$servicesCpt->the_post(); ?> | |
<!-- content here --> | |
<?php } // end while ?> | |
<?php | |
} // end if | |
wp_reset_postdata(); // reset after query | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment