WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone tell me why this isn't working? Assuming two things here - 1. WP Query handles multiple page requests, and 2. doesn't need a reset because I'm creating a new WP Query. What happens is I only get the last page to be shown (389). Above this code on the same page there is another WP Query that only fetches one page. Could this be the reason, or is it the way I request the pages? I've tried applying all the reset handlers but they gave no effect.

The code -

<?php $promo = new WP_Query( array( 'post_type' => 'page', 'post__in' => array(62,18,389) ) ); while ($promo->have_posts()) : $promo->the_post(); ?>
<?php the_permalink() ?>
<?php the_post_thumbnail() ?>
<?php the_title() ?>
<?php the_excerpt() ?>
<?php endwhile; ?>
share|improve this question
If you have found a solution, add it as an answer and mark your question as answered. – toscho Mar 10 '12 at 8:53

Because your posts are only saved whithin the $promo var and not in the $wp_query global var. I recommend you to use get_posts() http://codex.wordpress.org/Template_Tags/get_posts

share|improve this answer
Thanks for the tip. I solved it using a get_pages query and a foreach loop instead. – Staffan Estberg Oct 27 '11 at 20:09

You need to do paging in the WP Query to make it work right (using paged parameter)

share|improve this answer
Welcome to WordPress Stack Exchange. May I ask you to add a small working example? Rather abstract one-liners are frustrating to read for most of our members. :) – toscho Mar 10 '12 at 8:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.