[WordPress] 外掛分享: Automatic Submenu for Categories & Pages

WordPress 外掛 Automatic Submenu for Categories & Pages 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Automatic Submenu for Categories & Pages」是 2017-11-12 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2017-11-13,距離現在已有 2729 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.1 以上版本才可以安裝。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

rallisf1 |

外掛標籤

menu | pages | posts | submenu | children |

內容簡介

是否曾經想要自動將分類和頁面的子項目添加到您的菜單中?我確定我也是,但是發現沒有什麼簡單易用且不會干擾主題或其他外掛的東西。

現在,請耐心等待,因為這是我十年來的第一個 WP 外掛,也是第一次分享,所以我讓它變得很基本。

工作原理:

在每個類別或頁面的菜單項目上,您可以選擇自動添加其子項目作為子菜單
您可以決定顯示幾個子項目以及它們按標題或日期排序方式
就是這樣,您只需創建內容,就不必再擔心菜單。
正如承諾的那樣,它不會干擾主題或其他外掛,它只會在前端觸發導航菜單(nav menu)陣列中找到的相應位置注入子項目

代碼修改

這個外掛沒有設置頁面,但您可以從代碼自己更改一些默認行為

當該字段為空時更改默认最大子項目數
$item->automatic_max = 5;只需要在第220行更改數字

僅帶有頁面(Pages)直接後代,而不是所有祖先的子項目
$children = get_pages( array( 'child_of' => $item->object_id, 'number' => $item->automatic_max, 'sort_column' => 'post_'.$ordering[0], 'sort_order' => strtoupper( $ordering[1] ) ) ); 只需要在第226行將'child_of'改為 'parent'

即將推出的功能:

由於時間不足,我將根據需求實施以下功能。請在論壇上發布您的請求。

設置頁面
子菜單項目排序
支持自定義文章類型和稅onomies

特別感謝:

我使用了由 zviryatko 創建的菜單 Walker (https://plugins.trac.wordpress.org/browser/menu-image/trunk/menu-image.php)

原文外掛簡介

Ever wanted to be able to automatically have category and pages children automatically added to your menus? I’m sure I did and was disappointed to not find something that dead simple that works and doesn’t mess up with the theme or other plugins.
Now bear with me on this one as it is my first WP plugin for like a decade and the first ever to be shared so i kept it quite basic.
How it works:

On each menu item that is either a category or a page you get an option to automatically append their children as a submenu
You get to decide how many children to show and how they’re gonna be ordered (Title or Date)
And that’s it, all you have to do is create content and never worry about your menu again.
As promised, it doesn’t mess with the theme or other plugins, it just injects the children found in the corresponding place of the nav menu array when that is triggered in the frontend

Code hacks
There is no settings page for the plugin but you can change a couple default behaviours from the code itself
Changing the default maximum children number when the field is empty
$item->automatic_max = 5; just change the number at line 220

Bring only direct children of Pages and not all ascendants
$children = get_pages( array( 'child_of' => $item->object_id, 'number' => $item->automatic_max, 'sort_column' => 'post_'.$ordering[0], 'sort_order' => strtoupper( $ordering[1] ) ) ); just change 'child_of' to 'parent' at line 226

Upcoming Features:
Due to lack of time i will implement the following features upon demand. Please post your requests in the forum.

Settings Page
Submenu items ordering
Support for custom post types and taxonomies

Credits:

I have used the menu walker created by zviryatko (https://plugins.trac.wordpress.org/browser/menu-image/trunk/menu-image.php)

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Automatic Submenu for Categories & Pages」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


最新版本

延伸相關外掛(你可能也想知道)

  • Add Descendants As Submenu Items 》當你在導覽選單中添加頁面、分類或任何分層自訂文章類型或分類時(外觀 → 導覽選單),此外掛可選擇性地自動將該選單項目的所有後代(子項目)添加為子...。
  • SB Children block 》使用 Children block( oik-sb/children )來列出當前內容的子內容連結。, 可適用於任何支援頁面屬性(如 page)的階層式文章類型。。
  • Category Parent Children Selector 》「Category Parent Children Selector」是一個 WordPress 插件,可以幫助你選擇父子分類。, 主要功能包括:, , 選擇所有分類的按鈕。, 選擇所有分類及其所有...。
  • ZOOZA 》這個外掛能輕鬆整合 Zooza 小工具到你的網站中。, 支援的小工具包括:, , “Registration” 用於註冊新用戶到課程中, “Profle” 顯示用...。
  • Andy's List Subpages Plugin 》這款外掛非常簡單明瞭。在您想要列出子頁面的每個父頁面或文章中,只需輸入「?{list}?」。將其放在內容中的任何位置,它就會出現在那裡。然後在您的 CSS 中,...。
  • Child Page Tree 》Child Page Tree(孩子頁面樹狀列表)在頁面編輯網站的「發佈」按鈕正上方添加了一個下拉框。使用此下拉框,您可以決定是否添加及添加頁面樹的位置。您可以將...。
  • NotFound.org 404 Page 》這個外掛的目標是讓 WordPress 使用者可以輕鬆地將 NotFound.org 的失蹤兒童網頁取代他們的標準 404 頁面。, HTTP 404 是當連結失效或導向不存在的網頁時所看...。
  • Name: Children Excerpt Shortcode 》在您希望顯示子頁面摘要的地方使用 [children-excerpt] 短碼。, 默認顯示前 50 個字元,使用 length 屬性可以覆蓋默認值,讓您的摘要顯示更長或更短。, 開發...。
  • Child Navigation 》安裝此外掛後,您可以在 wp_nav_menu() 中添加功能以顯示當前頁面的子頁面或從特定的導覽級別開始顯示。。
  • Rescue Children Banner 》每年有超過 120 萬名兒童被販賣 * - 其中大部分被誘拐、收買或被迫從事性交易 **。, Destiny Rescue 致力於拯救被人口販運和性剝削的兒童。, 我們幫助救援受...。
  • Express Posts 》Express posts 提供了一個小工具,可顯示部分文章、頁面的子代或兄弟。, 小工具提供三種模式。, 子集會列出所選分類中給定數量的文章。日期、日期格式和摘要...。
  • Name: Children Index Shortcode Plugin 》在您想要顯示子頁面連結列表的地方使用 [children-index] 短碼。, 開發者網站: http://MyWebsiteAdvisor.com, 外掛頁面: http://mywebsiteadvisor.com/tools/...。
  • Name: Children Content Shortcode Plugin 》在需要顯示子頁面內容的位置使用 [children-content] 短碼。, 開發人員網站:http://MyWebsiteAdvisor.com, 外掛頁面:http://mywebsiteadvisor.com/tools/wo...。
  • Amber Alert Nederland 》這個 WordPress 外掛只會在有兒童失蹤(也就是所謂的AMBER Alerts)的情況下, 在您的網站上彈出一個訊息視窗。, 預計每年不會超過 10 次。您可以自己關閉彈...。
  • Kony 2012 Ribbon 》約瑟夫·科尼是全球最嚴重的戰爭罪犯之一。請支持抓捕他、解除危害區內洛特魯亞解放軍的武裝,並將童子軍遣回家園的國際努力。, 一條黑色帶有「Kony 2012」字...。

文章
Filter
Apply Filters
Mastodon