Theme for subcategories

You could use the template_redirect hook to check and see if your post is a category and then whether it is a sub-category … and if so, force a different template.

For example (assuming you are using wordpress categories)

function my_maybe_override_category_template( $template ) {
    # Make sure you are about to show a category term
    if ( is_category() ) {
        # Grab the term that content is to be displayed for
        global $wp_query;
        $term = $wp_query->get_queried_object();
        if ( 0 < (int)$term->parent ) {
            # This term has a parent, try to find your special child term template
            $found = locate_template('template_child_categories.php');
            if ( !empty( $found ) ) {
                # Override the normal template as we found the one we created
                $template = $found;
            }
        }
    }
}
add_action('template_redirect', 'my_maybe_override_category_template');

Unless I got something slightly off, that should do what you are wanting provided that:

  • You create a special template called template_child_categories.php, which will be used to show your child terms.