Support » Themes and Templates » Help with making a Category Templates.

  • Resolved Ken101


    I am at a loss on how to create a category template for 1 category in wordpress 2.0.2.
    I have seperated the site into 2 sections,
    1. pages and 2. posts.
    I am currently using “Permalinks” with this value:
    I have searched 3 days now and found nothing. The question is, I simply want to create category template for the page category. I sure it exists but I failed to find the answer. Any help would be great.
    I have tried the following:
    Suppose the Category ID of the Category in question is 6. WordPress uses the first Template file it finds in your current Theme’s directory from the following list.


    Worked great with the default structure “.com/?p=123” but fails to work with the permalinks. I have searched pretty much every plugin and failed to find a fix.
    If anyone can point me to a plugin or fix to this issue, it would be wonderful.

    Thanks to anyone who can help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • If by “pages” and “posts”, you really mean categories for Posts, you should be able to create different template files for the two categories, using the pattern you refer to.
    See Category Templates

    On the other hand, if the pages category contains pages of the Page type, there is a description in the Codex on how to create and use templates for Pages.

    Thank you for the reply but let me explain myself a little better.
    The content of the category I wish to create is irrelevant at the moment.

    It is very simple thing I need to accomplish,

    **I wish to put in place, a template for a specific category.**

    It’s as simple as that, but I am not capable of finding the documentation for this.
    Reason being, I am using Permalinks and not the standard structure so it doesn’t work.
    Please don’t reply with a link to this page
    I am fully aware of this page and have carefully read it about a dozen times looking for an answer to my question but I can’t seem to find it.
    I have created the template but am unable to have the category pull in this specific template when viewed.
    The question once again to be very clear, how to use a template for a specific category.
    I have tried naming the category template:
    category-7.php – as 7 is the category ID. no good
    category-reference.php – as “reference” is the category name. no good
    I have also tried:
    7-reference.php and more.
    I have wasted numerous hours trying to find this answer, but am not able to. I am sure the answer is under my nose but I just don’t have the energy any more to look for it so I am hoping someone here can make my weekend grand by pointing it out to me.

    I would be ever so grateful…


    Right! I don’t seem to get you the relive during the weekend.
    I’m not going to point you to that page again, but I’m a bit surprised that it doesn’t work. WordPress should pick up a category-6.php template for that category, independent of permalink structure.

    I’ll get back to you if I find something. Maybe someone else here have seen this problem and have a solution.

    In the meantime I’m curious about what type of difference you want between the “normal” categories and your special category.

    Thanks for the thought petit,
    As per the category-6.php not working, I have tried many times and cannot get it to work, at first I thought it was my cache of the page but still didn’t work after clearing the cache, so that wasn’t the problem.

    As per the categories, it is just like any other category when it comes down to the wordpress scheme. The only difference that I will be using it for is all articles posted that will not be commented on. More like a my version is the only version articles.(lol) It will be purely information articles on a certain subject.

    Thanks again.

    I’m not sure I fully understand the problem here, but if you’re trying to provide a template to posts within a category, and not just a template for the category, then take a look at my plugin:

    thanks for the reply Kafkaesqui, but a custom templates for all posts is not really what I am looking for. I have failed to catch the fact that to force a template on a category, there must be a (post) not a page posted on that category which makes it take effect. silly me, as that category is created to hold only pages and no posts. I am hoping I can bi-pass this somehow but failed to find the answer up to now. I am still trying to force a template on a category with no posts – if anyone can help, it would be great.

    I am also stuck on a way to import page info similar to post info on said category page.

    A post is displayed as follows
    I am at a loss to find the code to do similar with pages.
    Using the following code supplies the clickable titles which is great but no description.

      <?php wp_list_pages(‘sort_column=menu_order&title_li=’); ?>

    If anyone has an answer to this one also, that would be wonderful.

    Any help would be great…

    as that category is created to hold only pages and no posts

    This doesn’t really make sense since Pages do NOT have categories.

    I guess I should have read the basic concept of it before installing wordpress.

    Your absolutely right, I don’t know what I was thinking, I’m such a schmuck.

    Thank you for showing me the light. Must be those 18 hour work days zapping my brain cells…

    It seems so much clearer now.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Help with making a Category Templates.’ is closed to new replies.