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 noticed that when I changed the WP_Query to ask for a certain category, the page served was category.php. So I'm guessing there's a block of code somewhere that decides which template to serve based on keys in the query. Where is it?

share|improve this question
@t31os please move that to an answer. – Rarst Oct 14 '11 at 21:20
up vote 1 down vote accepted

The template loader determines which template to load for a given view, there's a filter available to change this though, template_include as seen on the source page linked.

Moved from comment to answer.

share|improve this answer
Thanks, exactly what I was looking for! – Isaac Lubow Jan 22 '12 at 10:58

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.