I am trying to set up my blog so that the following URL pattern:


Will use the template file category.php

I have created the template, however, when I access the URL, I just get the template front-page.php (I'm not being redirected - the URL in the address bar is still http://myblog.com/category/somecategory/)

The links to the category pages are being auto-generated by the Categories widget and each category has at least one post in it.

Can anyone help?


  • I'm not exactly sure what you're trying to accomplish. Could you try to clarify? – Jeremy Jared Oct 14 '11 at 12:45

Do you have:

  1. A category somecategory defined?
  2. Posts categorized with somecategory?
  3. Some default else: content in the Loop in category.php?

I suspect the URL is returning a 404, and WordPress is simply serving up the root URL, because it has no content to serve up from category.php.


You don't need to do anything special to get WordPress to use the category.php template. It is a built-in part of the Template Hierarchy. You simply need to have a category created, and have Posts in that category.


Can you try resetting your permalinks?

Do you have a live site link, so we can see the problem in action?

What is the markup of your category.php template file? Can you post it?

| improve this answer | |
  • I've updated the question based on your response. – Dan Oct 14 '11 at 13:07
  • See updated answer; have a few more questions for you. – Chip Bennett Oct 14 '11 at 13:35

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