Skip to content

Instantly share code, notes, and snippets.

@tomjn
Created August 2, 2013 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomjn/6142772 to your computer and use it in GitHub Desktop.
Save tomjn/6142772 to your computer and use it in GitHub Desktop.
A standard WP_Query loop to display pages
<?php
$query = new WP_Query( array(
'post_type' => 'page'
));
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
the_title();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment