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

I don't use The Loop, because I use different queries to fetch posts (I use 3 queries instead of one).

How to disable main query for home, category and search pages?

share|improve this question
up vote 2 down vote accepted

This is not trivial, because "home,category and search" are logically determined while main query churns through stuff. I am pretty sure I read this is possible, but that was in context of syndicating site that hadn't used posts/loop at all and scrapped it to do different stuff.

More typical approaches are:

  1. Integrate custom logic into main query, by using pre_get_posts, posts_* and other relevant filters.

  2. Leave main query for one of loops and implement other loops as secondary.

share|improve this answer
I will try that and report results. – Stancell Oct 2 '12 at 8:32
posts_request filter allows to replace main query. – Stancell Oct 2 '12 at 9:15

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.