Plugin Directory

Test out the new Plugin Directory and let us know what you think.
!This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Category Template Hierarchy

Adds parent-category.php, child-category.php, and child-category-{slug|id} templates to the hierarchy and conditional tags to match.

  • Changes made in 1.3.2 were not properly checked in - this version is a re-release of 1.3.2 - apologies for the inconvenience.


  • Bug: [FIXED] category-slug.php and category-id.php were being excluded from the list of templates if the current category was neither a parent or a child.


  • Bug: [FIXED] Plugin was not finding 'category.php' when it was available.


  • Bug: [FIXED] Template Hierarchy manipulation was interfering with other parts of the native Template Hierarchy, now uses 'category_template' filter instead of 'template_redirect'.
  • Bug: [FIXED] Child and Parent categories were not pulling $post and other normal globals into scope during the loop.
  • Minor Logic Change: is_child_of_category() and is_parent_of_category now check specifically for $category_parent->parent and $parent_category->term_id, because the way it was before, honestly did not make much sense.


  • Performance enhancement: Added a simple check to is_child_of_category_() and is_parent_of_category() to return false if empty, before bothering to check if there are relationships. Prevents a PHP notice caused by attempting to get the property of a non-object - this would occur when either function is called and the page is not a category at all.


  • Fixed 'print_pre' bug caused by a debugging function which I failed to remove when debugging was completed.


  • Completely restructured the hierarchical modifications this plugin creates.
  • Added child-of-category-{slug}.php and child-of-category-{id}.php templates
  • Added is_child_of_category() and is_parent_of_category() functions.
  • Removed child-category-{slug}.php, child-category-{id}.php, parent-category-{slug}.php, parent-category-{id}.php because they aren't very useful and just dont fit into the cool crowd.
  • Fixed all known bugs, and a few that were not known.


  • First actually stable release
  • Packaging problem fixed - the plugin was incorrectly packaged, such that it failed on activation.
  • Fixed several other very bad bugs


  • Fixed problems with the is_parent_category() and is_child_category() functions where they returned null if called from a non-category page.
  • Removed the 'happy accident' wherein a category which is both a parent and a child results in a hierarchy based on parent-child-categroy.php. This reveals a more important problem which I plan to fix for version 1.1.
  • Fixed a silly bug. Misspelled is_numberic rather than is_numeric.
  • Removed unnecessary exit.


  • Initial commit.

Requires: 3.0 or higher
Compatible up to: 3.3.2
Last Updated: 5 years ago
Active Installs: 1,000+


5 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 50,2,1 100,1,1 100,1,1 100,1,1