I am trying to set up my blog so that the following URL pattern:
http://myblog.com/category/somecategory/
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?
Thanks
Do you have:
somecategory
defined?somecategory
?else:
content in the Loop incategory.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
.EDIT
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.EDIT 2
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?