Forums

[resolved] Category Theme Template Not Working (4 posts)

  1. cowanservices
    Member
    Posted 2 years ago #

    I'm using WP as a CMS and want to use a different category template for each page in the site (it's very small, only 4 pages). I have created a template called category-3.php for the About page, and placed the template in the main theme directory. When I navigate to http://lovekidneys.com/beta/category-3.php, I get a 404 error. I'm not sure what is going on. I followed the directions on the Category Template page in the codex -- http://codex.wordpress.org/Category_Templates. Do I have the template in the wrong directory?

    Thanks in advance for any help.

    Lisa

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    You don't navigate directly to a category template file. It's applied automatically to the relevant category listing page - in this case, the category with the id 3. So just use the standard link to that category.

    However, if you're using WP as a CMS, you might want to consider sticking to Pages and child Pages. With custom page templates, if necessary.

  3. cowanservices
    Member
    Posted 2 years ago #

    What would the standard link to category 3 be? Also, what if I added a slug, so category 3 should now be category_about.php. Shouldn't I be able to go directly to that page?

    Also, the information on the home page is coming from category 4 instead of uncategorized content.

    http://lovekidneys.com/beta/

    Thanks in advance.

    Lisa

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    What would the standard link to category 3 be

    http://lovekidneys.com/beta/?cat=3
    The middle link on your top nav menu: "About Kidney Disease"

    Shouldn't I be able to go directly to that page?

    The key word to remember here is "template". The php files in your theme are frameworks for your content, They're not meant to be accessed directly.

    Also, the information on the home page is coming from category 4 instead of uncategorized content.

    Then move it to the appropriate category.

Topic Closed

This topic has been closed to new replies.

About this Topic