I have noticed that if I have a query where posts_per_page are set to 4, any (image) gallery that belongs to one of those posts will too have only 4 items (although when I create the gallery from Add new post the gallery has 10 images).

How can I fix this?

1 Answer 1


You need to post the query code of both the post query and the gallery query; no one can really make a guess otherwise.

You can try using <?php wp_reset_query(); ?> after the post query to force a reset.

See http://codex.wordpress.org/Function_Reference/wp_reset_query

  • But I don't really understand why a Gallery needs a query. After what may I reset the query? I would like every item in the gallery to appear, no matter there are 4 or 40 images in the gallery...Thanks
    – Alvaro
    Aug 15, 2012 at 0:10
  • I'm just guessing at the problem; that's all I can do. You haven't posted code or anything to work with. Aug 15, 2012 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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