• Hi,

    I’m trying to make a custom template for a bunch of categories that are children of one category. Let’s say I have a category (ID 5) and it has several children (IDs 6-12).

    Using custom category templates, category-5.php displays only as an archive for category 5, while its children use standard archive template. Is there a way to create a “category-5-12.php” kind of file? Or do I have to duplicate the template to create separate files for each ID?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Looks great, thanks.

    However, I have an issue. What I want to achieve is template with a layout (different from the rest of the archives) for these child categories.

    Using the plugin and, in my example, category-5.php to achieve the same layout for all child categories, I get the same effect on each of them: the loop seems to return all posts in category 5.

    What I need to have is category 6 page to display only category 6 posts etc.

    The current query_posts in the template files looks as follows:

    query_posts( 'paged=$page&post_per_page=-1&cat=' . get_query_var('cat') );

    I assume WordPress takes the 5 ID from the filename, how should I change the query_posts call to achieve the effect I need?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to make a template for child categories?’ is closed to new replies.