Title: bricka's Replies | WordPress.org

---

# bricka

  [  ](https://wordpress.org/support/users/bricka/)

 *   [Profile](https://wordpress.org/support/users/bricka/)
 *   [Topics Started](https://wordpress.org/support/users/bricka/topics/)
 *   [Replies Created](https://wordpress.org/support/users/bricka/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/bricka/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/bricka/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/bricka/engagements/)
 *   [Favorites](https://wordpress.org/support/users/bricka/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [May a category inherit template from its parent?](https://wordpress.org/support/topic/may-a-category-inherit-template-from-its-parent/)
 *  [bricka](https://wordpress.org/support/users/bricka/)
 * (@bricka)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/may-a-category-inherit-template-from-its-parent/#post-326358)
 * Is it possible to modify this plugin so that sub-sub-categories can inherit the
   template? I tried this modification but it didn’t seem to work:
 * `function szub_cat_template_inherit() {
    if(is_category()) { global $wp_query;
   $category = $wp_query->get_queried_object(); if( $category->category_parent &&
   amp; $category->category_parent->category_parent ) $template = TEMPLATEPATH .'/
   category-' . $category->category_parent->category_parent . '.php'; elseif( $category-
   >category_parent &&amp; file_exists(TEMPLATEPATH . '/category-' . $category->
   category_parent . '.php') ) $template = TEMPLATEPATH . '/category-' . $category-
   >category_parent . '.php'; elseif( file_exists(TEMPLATEPATH . "/category-" . 
   get_query_var('cat') . '.php') ) $template = TEMPLATEPATH . "/category-" . get_query_var('
   cat') . '.php'; elseif( file_exists(TEMPLATEPATH . "/category.php") ) $template
   = TEMPLATEPATH . "/category.php";
 *  return $template;
    } }

Viewing 1 replies (of 1 total)