Created
May 20, 2013 18:36
-
-
Save delputnam/5614269 to your computer and use it in GitHub Desktop.
Get all WordPress posts of a certain type that have been published.
This file contains hidden or 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
$query = new WP_Query( array( | |
'post_type' => 'event_type', | |
'post_status' => 'publish', | |
'nopaging' => true | |
) ); | |
while ( $query->have_posts() ) : $query->the_post(); | |
// Do something with the post here... | |
endwhile; | |
wp_reset_postdata(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment