前言介紹
- 這款 WordPress 外掛「Elevate Parent Category Template」是 2008-08-02 上架。
- 目前有 70 個安裝啟用數。
- 上一次更新是 2011-03-14,距離現在已有 5165 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 2.5 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
echoz |
外掛標籤
內容簡介
此外掛可提供函數來取得指定文章的母類別(父類別)資訊,若該文章被歸入於母類別的子類別中。
透過這個功能,此外掛也能夠修改 WordPress 迴圈(Loop)並將產生任何類別頁面的操作重新定向至母類別。這對於主題開發人員希望能夠指定 category-x.php 模板並讓所有相關文章,無論是指定到該類別或其子類別,都使用該模板進行頁面產生的情況非常有用。
舉例來說,目前的類別結構如下:
主類別(已設有 category-x.php 模板)
子類別 1
子類別 2
一篇文章被指定到『子類別 2』中。
當該文章被請求時,此外掛將會自動檢測是否有母類別。若有,它將會修改 WP 變數,將當前類別設為母類別,同時添加一個新變數,指出該文章實際所處類別。這會影響 WordPress 迴圈,使其使用父類別定義的 category-x.php 模板。
主題開發人員可用的指令
主題開發人員可使用的 PHP 指令非常直覺易懂。
get_category_child() 可回傳當前文章的子類別 ID。
is_parent() 可檢查當前文章是否在母類別中。
get_category_title($id) 可取得 $id 所屬類別的標題。
get_category_parent() 可回傳當前文章的母類別 ID。
原文外掛簡介
This plugin provides functions to retrieve the parent category of any particular post should it be assigned to a sub category of that parent category.
Using this feature, the plugin is also able to modify the WordPress Loop to redirect any category page generation to the parent category. This is especially useful when theme developers want to be able to specify category-x.php templates and have all related posts, be it those assigned to the category or the sub categories use that template for page generation.
So for example the current category structure is as follows.
Main Category (has category-x.php template)
Sub Category 1
Sub Category 2
A post is assigned to “Sub Category 2”.
When the post is requested the plugin will automatically detect if it has a parent category. If so, it will modify the WP variables to set the current category as the parent category and add a new variable stating the actual category of the post. This affects the WordPress Loop to category-x.php template defined for the parent
Usable Commands for Theme Developers
The PHP commands for theme developers to use are pretty straight forward.
get_category_child() returns the current post child category ID.
is_parent() checks if the current post is at the parent category.
get_category_title($id) gets the title of the category that is $id.
get_category_parent() returns the current post’s parent category ID.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Elevate Parent Category Template」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 1.0.1 | 1.0.2 | 1.0.3 | 1.0.4 | trunk |
延伸相關外掛(你可能也想知道)
Template Kit – Import 》一個範本套件是一組預先設計好的起始範本,供 WordPress 網站建立者使用,並具有統一的視覺風格。, 您可以使用此外掛程式匯入 Elementor 的範本套件。, 啟用...。
Show Current Template 》這是一款 WordPress 外掛程式,可以在工具列中顯示目前的模板檔案名稱、主題名稱和已包含的模板檔案名稱。如果您喜歡這個外掛, 歡迎買我一杯咖啡!😉此外,...。
What The File 》What The File 是一個 WordPress 外掛,在您的工具列中增加了一個選項,顯示目前正在檢視的頁面所使用的文件和模板部分。, 您可以通過單擊文件名直接使用佈景...。
Custom Field Template 》「Custom Field Template 外掛」在「編寫文章/頁面」時,新增自訂欄位的預設設定。這個模板格式基本上跟「rc:custom_field_gui 外掛」差不多,不同處在於:, ...。
Fullwidth Templates for Any Theme & Page Builder 》全寬度網頁範本外掛, 你的佈景主題是否提供全寬度網頁範本?是否需要使用 Beaver Builder、Elementor 等頁面構建者來設計漂亮的全寬度佈局?是否需要完全沒有...。
TinyMCE Templates 》TinyMCE Template 外掛可在 WordPress 視覺化編輯器上使用 HTML 範本。, , 官網, GitHub, , 部份功能:, , 加入「插入範本」按鈕至視覺化編輯器。, 你可在 Wor...。
Multiple Themes 》重要提示:支援服務已移至 ZATZLabs 網站,不再於 WordPress.org 論壇提供。如需開發者迅速回覆,請提交請求單。, 此外掛設定提供多種選擇方式,可讓您選擇要...。
Genesis Custom Blocks 》Genesis Custom Blocks 為 WordPress 開發人員提供了必要的工具,以應對現代 WordPress 「區塊先行」的實境。, WordPress 區塊編輯器(又稱 Gutenberg)為我...。
Custom Post Template 》提供一個下拉式功能,讓您可以在文章編輯頁面中選擇不同的模板。這些模板和頁面模板類似,且會取代指定文章的 single.php。然而此外掛並不會在文章列表頁面(...。
Canvas 》這是一個翻轉傳統的基於區塊的頁面建構器,結合了WordPress 區塊編輯器的特點,擁有卓越的 UI 設計。。
Gantry 5 Framework 》Gantry 5是一個全面的建構模組集,可協助快速將設計實現為具有彈性和功能強大的網站主題。, , 請訪問http://gantry.org以下載免費的WordPress Gantry 5預設主...。
A WP Life Companion 》這個 A WP Life Companion 外掛是為 A WordPress Life 主題所創建的。, 此外掛會為 A WordPress Life 主題添加自訂前頁區塊,並允許您完全自訂主題前頁區塊的...。
WP Layouts 》利用 WP Layouts,您不再需要花時間在硬碟或雲端導入、導出、排序、搜尋及組織 JSON 檔案。這是目前最佳的方式可以讓您整理、導入及導出版面配置,特別是當您...。
Export Themes 》這個外掛讓你能夠將主題以 .zip 檔案匯出,然後利用 WordPress 的「上傳」功能,在其他伺服器上安裝相同的主題。, 使用方式, 安裝完外掛後,你需要進入「外觀...。
which template file 》想知道 WordPress 在前台顯示頁面時使用哪個模板嗎?, 這個外掛可以幫您達成這個目的。您可以在免費的模擬網站上嘗試使用:點此連結 => https://tastewp.c...。