{"id":215967,"date":"2011-11-06T08:00:00","date_gmt":"2011-11-06T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/wp-use-parent-template\/"},"modified":"2011-12-06T19:06:00","modified_gmt":"2011-12-06T19:06:00","slug":"wp-use-parent-template","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/wp-use-parent-template\/","title":{"rendered":"WP Use parent template"},"content":{"rendered":"<h4>Features<\/h4>\n<ul>\n<li>use parent template for child category.<\/li>\n<li>use parent template for child page.<\/li>\n<\/ul>\n<p>If you have works category with some child categories as followings, you may want to use \u2018category-works.php\u2019 for all three child categories. You need to copy as \u2018category-design.php\u2019 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.<\/p>\n<ul>\n<li>example.com\/works\/design<\/li>\n<li>example.com\/works\/illust<\/li>\n<li>example.com\/works\/photo<\/li>\n<\/ul>\n<h4>Category template hierarchy<\/h4>\n<ol>\n<li>category-{slug}.php<\/li>\n<li>category-{id}.php<\/li>\n<li>category-{parent slug}.php \/\/Add by WP Use parent template<\/li>\n<li>category-{parent id}.php \/\/Add by WP Use parent template<\/li>\n<li>category.php<\/li>\n<li>archive.php<\/li>\n<li>index.php<\/li>\n<\/ol>\n<h4>Page template hierarchy<\/h4>\n<ol>\n<li>custom template file<\/li>\n<li>page-{slug}.php<\/li>\n<li>page-{id}.php<\/li>\n<li>page-{parent slug}.php \/\/Add by WP Use parent template<\/li>\n<li>page-{parent id}.php \/\/Add by WP Use parent template<\/li>\n<li>page.php<\/li>\n<li>index.php<\/li>\n<\/ol>\n<p>See following for WordPress default template hierarchy.<br \/>\nhttps:\/\/codex.wordpress.org\/Template_Hierarchy<\/p>\n<h4>Notes<\/h4>\n<ul>\n<li>Able to use only one generation age template. \u2018category-child.php\u2019 is able to use as parent template for grandchild in the example of \u2018example.com\/parent\/child\/grandchild\u2019.<\/li>\n<li>You may need to change parent template to handle child data.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>To use parent template for child categories or pages. This plugin patches template hierarchy. This plugin is for who create or customize themes.<\/p>\n","protected":false},"author":65,"featured_media":228505,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"WP Use parent template - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"To use parent template for child categories or pages. This plugin patches template hierarchy. This plugin is for who create or customize themes."},"footnotes":""},"categories":[1],"tags":[11,1964,199,628],"class_list":["post-215967","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-category","tag-hierarchy","tag-page","tag-template"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/215967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=215967"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/215967\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/228505"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=215967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=215967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=215967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}