To use parent template for child categories or pages. This plugin patches template hierarchy. This plugin is for who create or customize themes.
Author: | kanonji (profile at wordpress.org) |
WordPress version required: | 3.2 |
WordPress version tested: | 3.2.1 |
Plugin version: | 0.4 |
Added to WordPress repository: | 06-11-2011 |
Last updated: | 06-12-2011
Warning! This plugin has not 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.
|
Rating, %: | 20 |
Rated by: | 1 |
Plugin URI: | https://github.com/kanonji/wp-use-parent-temp... |
Total downloads: | 2 039 |
Active installs: | 10+ |
![]() Click to start download |
Features
- use parent template for child category.
- use parent template for child page.
If you have works category with some child categories as followings, you may want to use ‘category-works.php’ for all three child categories. You need to copy as ‘category-design.php’ and the rest in default template hierarchy. WP Use parent template patches the template hierarchy to use parent template for these child categories. And also pages too.
- example.com/works/design
- example.com/works/illust
- example.com/works/photo
Category template hierarchy
- category-{slug}.php
- category-{id}.php
- category-{parent slug}.php //Add by WP Use parent template
- category-{parent id}.php //Add by WP Use parent template
- category.php
- archive.php
- index.php
Page template hierarchy
- custom template file
- page-{slug}.php
- page-{id}.php
- page-{parent slug}.php //Add by WP Use parent template
- page-{parent id}.php //Add by WP Use parent template
- page.php
- index.php
See following for WordPress default template hierarchy.
https://codex.wordpress.org/Template_Hierarchy
Notes
- Able to use only one generation age template. ‘category-child.php’ is able to use as parent template for grandchild in the example of ‘example.com/parent/child/grandchild’.
- You may need to change parent template to handle child data.
ChangeLog