內容簡介
這個外掛讓佈景主題作者能在主題中自動使用基於頁面父代的模板。
例如,在您的主題目錄中添加文件 "page-123.php" 到 "child-page-templates" 資料夾,就會定義所有子頁面的模板,這些子頁面是與 ID #123 的頁面相關的。您也可以用文章的 slug 做同樣的事情。
這個模板檔案將用於所有子頁面與 ID #123 的頁面相關:
/wp-content/themes/your-awesome-theme/child-page-templates/page-123.php
這個模板檔案將用於所有與 "team" slug 相關的子頁面:
/wp-content/themes/your-awesome-theme/child-page-templates/page-team.php
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Allows theme authors to include templates that will be automatically used based on the page’s parent.
For example, adding the file “page-123.php” to the “child-page-templates” folder in your theme directory will define the template for all pages that are children of the page with ID #123. You can also do the same thing with the post’s slug.
This template file will be used for all pages that are children of the page with ID #123:
/wp-content/themes/your-awesome-theme/child-page-templates/page-123.php
This template file will be used for all pages that are children of the page with the “team” slug:
/wp-content/themes/your-awesome-theme/child-page-templates/page-team.php
