
內容簡介
新增一種 Widget 型別,您可以在側邊欄區域 (和/或其他地方) 部署這個 Widget,以顯示基於區段的導覽列,同時可以排除顯示某些頁面。
Widget 標題是當前區段的最高層級頁面。然後,Widget 可以顯示所有該頁面的已發布同級別兄弟 (除了最高層級頁面),所有父親和祖先 (以及更高層級),所有父親和祖先的同級別兄弟 (直到最高層級頁面),以及當前頁面的任何直接子頁面。也可以在模板檔內使用函式呼叫。
它包括一個簡單的 Widget 設定面板,您可以從這個面板決定:
決定 Widget 是否出現在首頁
覆寫標準行為,使 Widget 顯示當前區段中的所有頁面
決定即使該區段僅有一頁 (最高層級) ,Widget 是否仍應出現
提供要從輸出中排除的頁面清單
決定是否在查看排除的頁面時仍應顯示區段導覽
使用特定的 Widget 標題 (例如「本區段」) ,或只使用最高層級頁面標題
決定是否應將區段標題鏈結
決定頁面排序 (預設為菜單順序)
該 Widget 使用標準的 WordPress 導覽類別,以及 Widget 周圍的唯一類別,方便樣式設計。頁面清單的 UL 還具有一個自定義類別 bsn-list,可以通過 bsn_list_class 過濾器更改。
從 1.5 版本開始,Better Section Navigation 還將已取消的 Exclude Pages 外掛功能納入其中,讓您可以有選擇性地排除特定頁面不出現在 Better Section Navigation 生成的 Widget 中。該逐頁控制通過文章編輯頁面的 metabox 管理。注意:啟用時,BSN 將自動導入透過該外掛設置的“排除頁面”清單,因此您無需在停用舊版之前手動重新指定已排除的頁面。
支援 WordPress Multisite。
此外掛的前身為 Simple Section Navigation Widget,但由於該外掛已經停止更新,我們已接手這項任務,目標是保持其與最新的 WordPress 慣例相符 (即消除不推薦警告) ,同時保留原始外掛的一些簡單特性,並添加一些有用的功能。
Simple Section Navigation Widget 與 PHP 8.x 不兼容,因此自 2022 年 10 月開始,Better Section Navigation 現在是 Simple Section Navigation Widget 的即插即用替代品。如果您一直在使用 Simple Section Navigation,現在可以在不更改任何設置的情況下改用該插件! 注意:在啟用 Better Section Navigation 之前,請停用 Simple Section Navigation Widget。
外掛標籤
開發者團隊
原文外掛簡介
Adds a new widget type you can deploy in your sidebar regions (and/or elsewhere) to display section-based navigation, along with the ability to exclude certain pages from showing up.
The title of the widget is the top level page within the current section. The widget then can show all of the page’s published siblings (except on the top level page), all parents and grandparents (and higher), the siblings of all parents and grandparents (up to top level page), and any immediate children of the current page. It can also be called by a function inside template files.
It includes a simple widget configuration panel. From this panel you can:
Determine whether the widget should appear on the home page
Override standard behavior and have the widget show all pages in the current section
Determine whether the widget should appear even if the section only has one page (the top level)
Provide a list of pages to exclude from the output
Determine whether the section navigation should still appear when viewing excluded pages
Use a specific widget title (i.e. In This Section), or just use the top level page title
Determine whether the section title should be linked
Determine page sort order (defaults to menu order)
The widget uses standard WordPress navigation classes, in addition to a unique class around the widget, for easy styling. The UL of the page list also has a custom class, bsn-list, that can be altered via the bsn_list_class filter.
Beginning with version 1.5, Better Section Navigation also incorporates the features of the defunct Exclude Pages plugin, giving you the ability to selectively exclude specific pages from appearing in the widget generated by Better Section Navigation. This per-page control is managed via a metabox on the post edit screen. Note: On activation, BSN will automatically import the list of “excluded pages” set via that plugin, so you don’t have to manually re-assign excludes pages before deactivating the old one.
Compatible with WordPress Multisite.
This plugin started life as Simple Section Navigation Widget, but since that plugin hasn’t been updated in a while, we’ve taken up the reins with the goal of keeping it up to date with the latest WordPress conventions (i.e. getting rid of deprecation warnings) and adding a few nice-to-have features while retaining some of the simplicity of the original plugin.
Simple Section Navigation Widget is incompatible with PHP 8.x, so as of October 2022, Better Section Navigation is now a drop-in replacement for Simple Section Navigation Widget. If you’ve been using Simple Section Navigation, you can now use this one instead without changing any settings! NOTE: Deactivate Simple Section Navigation Widget before activating Better Section Navigation.
