Skip to content

Instantly share code, notes, and snippets.

@ashby
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save ashby/59bd1d0d6f9eda93e995 to your computer and use it in GitHub Desktop.

Select an option

Save ashby/59bd1d0d6f9eda93e995 to your computer and use it in GitHub Desktop.
WP: WP_Query
$args = array();
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
}
} else {
}
wp_reset_postdata();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment