[WordPress] 外掛分享: Custom Post Type Parents

首頁外掛目錄 › Custom Post Type Parents
900+
安裝啟用
★★★★
4/5 分(6 則評價)
9 天前
最後更新
問題解決
WordPress 3.5+ v1.1.3 上架:2015-02-02

內容簡介

Custom Post Type Parents 外掛旨在解決在自訂文章類型的選單和頁面列表中突出顯示「父頁面」的問題。它能夠與自訂選單輸出及使用 wp_list_pages() 函數的頁面樣式類別進行整合,提升使用者的導航體驗。

【主要功能】
• 突出顯示自訂文章類型的父頁面
• 與自訂選單輸出整合
• 自動應用標準 WordPress 類別

外掛標籤

開發者團隊

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

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

原文外掛簡介

Compatible with PHP 8.2
Like this plugin? Please consider leaving a 5-star review.
This plugin is meant to solve the problem of highlighting “parent” pages for Custom Post Types in the menu and lists of pages. It integrates with custom menu output as well as output for any functions like wp_list_pages() that utilize the page_css_class or nav_menu_css_class filters. When viewing a custom post type, the assigned “parent page” will be indicated with standard WordPress classes (e.g. current_page_item) in navigation menus and lists of pages.
Usage

In the admin, navigate to Settings > Custom Post Type Parents
For each custom post type, use the dropdown to select a “parent page”

Menus and lists of pages will now have the appropriate classes applied to the specified parent pages. Additionally, Custom Post Type Parents will apply these classes to Simple Section Navigation widgets, if the plugin is installed.
Classes
Custom Post Type Parents applies the following classes to parent and ancestor pages (all classes are consistent with default WordPress classes and are backwards compatible).
Parent
* current-menu-parent
* current_page_parent
* current-custom-post-type-parent
* current-{post type}-parent
Ancestor
* current-menu-ancestor
* current_page_ancestor
* current-custom-post-type-ancestor
* current-{post type}-ancestor

延伸相關外掛

文章
Filter
Apply Filters
Mastodon