• Resolved cathiet

    (@cathiet)


    I am attempting to incorporate a categories list in a category template page.

    For example, I have placed the following code into the category-13.php file.

    <?php wp_list_categories('child_of=13&title_li='); ?>

    From the description on Codex, I expect the resulting list of links to use the category-13.php template to display the results of the category link lists. In other words, if I click on a link from the category list it should use the same template as it’s parent category (13).

    However, it defaults to the category.php template. If I remove this file from my server, then it uses archives.php, and again if I remove this file it uses another one which I can’t seem to identify.

    Can you please tell me how I can work this out so it displays with the related category template?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Even if a category is a child of another, it haves is own category ID… So you will also need a template for this child category ID…

    When you write a post, if you only check the category child box, the post will not automatically belong to the “mother” category… You must also check the mother’s category box…

    So, you have two solution :

    1) Make a template with the child category ID

    2) When you write a post, check both the box for the “mother” and the “child” (meaning this post will belong to two category ID)

    S.

    This might help to understand the templates:
    Template_Hierarchy

    Thread Starter cathiet

    (@cathiet)

    SimonJ and moshu:

    Thank you so much for all your help.

    I do have all the posts marked with both the mother and child categories, but for whatever reason, it wasn’t upholding the hierarchy rules.

    However, I went ahead and created a category-X.php file for each child category and now it is working as I initially intended.

    Thank you again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category Template Page Not Displaying’ is closed to new replies.