Skip to content

Instantly share code, notes, and snippets.

@bonny
Created February 22, 2013 09:31
Show Gist options
  • Save bonny/5012072 to your computer and use it in GitHub Desktop.
Save bonny/5012072 to your computer and use it in GitHub Desktop.
<?php
// Setup a wp_query object that gets the pages with id 1,2 and 3
$query = new wp_query('post_type=page&post__in=1,2,3');
while ($query->have_posts() ) :
$query->the_post();
echo "<p>Found a post with title: " . get_the_title() . "</p>";
endwhile;
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment