WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!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.

1.3.2.1

  • 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.

1.3.2

  • 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.

1.3.1

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

1.3

  • 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.

1.2

  • 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.

1.1.1

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

1.1

  • 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.

1.0.5

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

1.0.3

  • 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.

1.0

  • Initial commit.

Requires: 3.0 or higher
Compatible up to: 3.3.2
Last Updated: 2012-3-21
Downloads: 16,067

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
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 100,1,1
100,1,1 50,2,1 100,1,1 100,1,1 100,1,1
100,2,2
100,1,1
100,1,1