[WordPress] 外掛分享: Child Page Templates

首頁外掛目錄 › Child Page Templates
10+
安裝啟用
尚無評分
4920 天前
最後更新
問題解決
WordPress 3.3+ v1.0.2 上架:2012-09-27

內容簡介

這個外掛讓佈景主題作者能在主題中自動使用基於頁面父代的模板。

例如,在您的主題目錄中添加文件 "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

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Child Page Templates」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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

延伸相關外掛

文章
Filter
Apply Filters
Mastodon