前言介紹
- 這款 WordPress 外掛「Collapsing Categories」是 2008-01-06 上架。
- 目前有 5000 個安裝啟用數。
- 上一次更新是 2025-05-01,距離現在已有 2 天。
- 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
- 有 57 人給過評分。
- 論壇上目前有 1 個提問,問題解答率 100% ,不低,算是個很有心解決問題的開發者團隊了!
外掛協作開發者
robfelty |
外掛標籤
widget | sidebar | categories | navigation |
內容簡介
20;17;9;6;5;4;3;2;1;0'>展開的預設設定值,可使用類別 ID
postTitleLength- 標題最大字元數(預設值:0,無限制)
accordion- 1(真),2個或多個標題不能同時展開;0(假)預設
catfeed- 展示第一個子類別的文章或RSS URL。/feed 為您的網站的預設設定。或填寫任何您想使用的 RSS URL。none(預設)
taxonomy- 運行所使用的分類法。默認:category。
showPostDate- 在文章標題後面顯示文章日期(預設值:false)
postDateAppend- 在日期後方加上文章(title)或貼文(content)(預設值:after)
postDateFormat- 以 PHP date格式來顯示文章日期(預設值: m/d)
useCookies- 啟用(true) /禁用(false)分類和帖子的展開記錄COOKIE。(預設值: true)
showTopLevel- 如果為假(false),則不顯示第一層類別(預設值: true)
postsBeforeCats- 如果為真(true),則在每個類別列表上方顯示文章標題(預設值:false)
expandCatPost- 如果為假(false),則展開子類別時不顯示相關聯的文章列表(選項expand=2;預設值:true)
debug- 啟用(1)/禁用(0)WordPress錯誤報告(使用插件時啟用除錯)
原文外掛簡介
Collapsing Categories creates an expandable list of categories and
subcategories. It can also expand to show posts. The primary usage is as a
widget, but you can also use the code in your theme manually if you wish (see
installation instructions)
Options
Options can be set
from the block panel. If you wish to insert the code into your theme manually
instead of using a widget, you can use the following options. These options
can be given to the collapsCat() function either as an array or in query
style, in the same manner as the wp_list_categories function.
$defaults=array(
'showPostCount' => true,
'inExclude' => 'exclude',
'inExcludeCats' => '',
'showPosts' => true,
'showPages' => false,
'linkToCat' => true,
'olderThan' => 0,
'excludeAll' => '0',
'catSortOrder' => 'ASC',
'catSort' => 'catName',
'postSortOrder' => 'ASC',
'postSort' => 'postTitle',
'expand' => '0',
'defaultExpand' => '',
'postTitleLength' => 0,
'accordion' => 0,
'catfeed' => 'none',
'taxonomy' => 'category',
'showPostDate' => false,
'postDateAppend' => 'after',
'postDateFormat' => 'm/d',
'useCookies' => true,
'showTopLevel' => true,
'postsBeforeCats' => false,
'expandCatPost' => true,
'debug'=>'0'
);
inExclude
Whether to include or exclude certain categories
‘exclude’ (default)
‘include’
inExcludeCats
The categories which should be included or excluded
showPages
Whether or not to include pages as well as posts. Default if false
linkToCat
1 (true), clicking on a category title will link to the category archive (default)
0 (false), clicking on a category title expands and collapses
catSort
How to sort the categorys. Possible values:
‘catName’ the title of the category (default)
‘catId’ the Id of the category
‘catSlug’ the url of the category
‘catCount’ the number of posts in the category
‘catOrder’ custom order specified in the categorys settings
catSortOrder
Whether categories should be sorted in normal or reverse
order. Possible values:
‘ASC’ normal order (a-z 0-9) (default)
‘DESC’ reverse order (z-a 9-0)
postSort
How to sort the posts. Possible values:
‘postDate’ the date of the post (default)
‘postId’ the Id of the post
‘postTitle’ the title of the post
‘postComment’ the number of comments on the post
‘postOrder’ sort by menu order
postSortOrder
Whether post should be sorted in normal or reverse
order. Possible values:
‘ASC’ normal order (a-z 0-9) (default)
‘DESC’ reverse order (z-a 9-0)
expand
The symbols to be used to mark expanding and collapsing. Possible values:
‘0’ Triangles (default)
‘1’ + –
‘2’ [+] [-]
‘3’ images (you can upload your own if you wish)
‘4’ custom symbols
customExpand
If you have selected ‘4’ for the expand option, this character will be
used to mark expandable link categories
customCollapse
If you have selected ‘4’ for the expand option, this character will be
used to mark collapsible link categories
postTitleLength
Truncate post titles to this number of characters (default: 0 = don’t
truncate)
accordion
When set to true, expanding one category closes all others at that level
catfeed
Whether to add a link to the rss feed for a category. Possible values:
‘none’ (default)
‘text’ shows RSS
‘image’ shows an RSS icon
taxonomy
Type of taxonmy to display. Possible values:
‘category’ (default)
‘link_category’
‘post_tag’
‘both’ (categories and tags)
any other registered taxononmy (e.g. recipe press uses recipe-categories)
showPostDate
When true, show the date of each post
postDateAppend
Show the date before or after the post title. Possible values:
‘after’ (default)
‘before’
postDateFormat
What format the post date is in. This uses the standard php date
formatting codes
useCookies
When true, expanding and collapsing of categories is remembered for each
visitor. When false, categories are always display collapsed (unless
explicitly set to auto-expand). Possible values:
1 (true) (default)
0 (false)
showTopLevel
When set to false, the top level category will not be shown. This could
be useful if you only want to show subcategories from one particular
top-level category
1 (true) (default)
0 (false)
postsBeforeCats
When set to true, posts in category X will be ordered before
subcategories of category X
1 (true)
0 (false) (default)
expandCatPost
When set to true, any category to which a post is assigned will
automatically be expanded on a single post page.
1 (true) (default)
0 (false)
showEmptyCat
When set to true, empty categories are shown
0 (false) (default)
1 (true)
debug
When set to true, extra debugging information will be displayed in the
underlying code of your page (but not visible from the browser). Use
this option if you are having problems
Examples
collapsCat('catSort=ASC&expand=3&inExcludeCats=general,uncategorized')
This will produce a list with:
* categories shown in alphabetical order
* using images to mark collapsing and expanding
* exclude posts from the categories general and uncategorized
`
‘postDate’,
‘postSortOrder’ => ‘DESC’,
) );
} else {
wp_get_categories(‘your_options_here’);
}
echo “
\n”;
?>
`
Demo
I use this plugin in my blog at http://robfelty.com
CAVEAT
Currently this plugin relies on Javascript to expand and collapse the links.
If a user’s browser doesn’t support javascript they won’t see the links to the
posts, but the links to the categories will still work (which is the default
behavior in wordpress anyways)
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Collapsing Categories」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.1 | 1.2 | 2.0 | 2.1 | 0.3.7 | 0.4.4 | 0.6.6 | 0.7.1 | 0.8.5 | 0.9.9 | 1.0.1 | 1.0.2 | 1.1.1 | 1.2.1 | 1.2.2 | 2.0.1 | 2.0.3 | 2.0.4 | 2.0.5 | 2.0.6 | 2.0.7 | 2.0.8 | 2.0.9 | 2.1.1 | 2.1.2 | 2.2.7 | 3.0.3 | 3.0.4 | 3.0.5 | 3.0.7 | 3.0.8 | 3.0.9 | trunk | 0.5.10 | 3.0.10 | 3.0.11 | 1.0.beta | 1.0.alpha |
延伸相關外掛(你可能也想知道)
Widgets for Google Reviews 》onal version of our review software, you can:, , , Display unlimited Google Reviews, Customize widget design and behavior, Respond to reviews direc...。
Blocksy Companion 》Blocksy Companion 是一個外掛,將 Blocksy 主題轉化為強大的瑞士軍刀工具。, 只有在安裝並啟用 Blocksy 主題時,它才會運行並添加增強功能。, 最小需求, , W...。
Black Studio TinyMCE Widget 》此外掛添加了一個新的 Visual Editor 小工具類型,讓您能夠在側邊欄中輕鬆地插入豐富的文字和媒體對象。使用 Black Studio TinyMCE Widget 時,您將能夠使用W...。
Widget Importer & Exporter 》Widget Importer & Exporter 是一個有用的外掛,可將小工具從一個WordPress站點移動到另一個站點,備份小工具,並供主題開發人員為用戶提供範例小工具。...。
Orbit Fox by ThemeIsle 》透過Orbit Fox,您可以使用各種模組擴充您的主題功能,例如社交媒體分享按鈕和圖示、自訂選單圖示、頁首和頁尾腳本、一鍵導入頁面模板、頁面建構器附加元件和...。
Recent Posts Widget With Thumbnails 》列出最新的文章標題、縮略圖、摘要、作者、類別、日期等等!, 雖然此外掛僅建立在小工具區域,但使用者報告說它在 Elementor 和 Oxygen 上運作順暢。但它是否...。
WordPress Popular Posts 》WordPress Popular Posts 是一個高度可定製的小工具,可以顯示您最受歡迎的文章。, 主要特點, , 多小工具功能 – 您可以在您的博客上擁有多個 WordPress...。
Widget Logic 》此外掛可在每個小工具中新增一個名為 "Widget logic" 的額外控制欄,讓您控制這個小工具會出現在哪些頁面上。文字欄位允許您使用 WP 的Conditional Tags或任...。
Social Media Share Buttons & Social Sharing Icons 》在你的免費測試網站上試試看:點擊此處 => https://tastewp.com/plugins/ultimate-social-media-icons, (這個技巧適用於所有外掛 – 只需在外掛的 WP 存儲庫 ...。
Fixed Widget and Sticky Elements for WordPress 》使用 Fixed Widget 外掛可以創建黏貼式的小部件、區塊和其他元素,當用戶向上或向下滾動頁面時,它們會保持在可見的屏幕區域內。, 相較於非固定小工具,黏貼...。
PHP Code Widget 》普通的文字小工具允許您插入任意文字和/或 HTML 代碼。這個外掛程式也允許這樣做,但還會解析文本小工具中的任何 PHP 代碼並執行它。, 這可以讓您更輕鬆地遷...。
Image Widget 》Image Widget 是一個簡單的外掛程式,利用 WordPress 原生媒體管理員,為您的網站新增圖片小工具。, 需要新增幻燈片、燈箱或隨機圖像嗎?, 請查看 Image Widg...。
Custom Sidebars – Dynamic Sidebar Classic Widget Area Manager 》使用 Custom Sidebars,一個靈活的小工具管理器,在您的網站上管理和替換側邊欄和其他小工具區。, 製作自訂側邊欄配置,能夠選擇在您網站的每個頁面或文章上...。
Recent Posts Widget Extended 》外掛描述, 此外掛可以啟用自定義、靈活且進階的最新文章功能,您可以透過簡碼或小工具來顯示它。您可以顯示具有縮略圖、摘要和發佈日期的最新文章清單,並且...。
Widget Shortcode 》這個短碼需要小工具的ID,但不需要猜測,外掛會為你生成代碼。如果你想要覆蓋小工具的標題,你可以使用 "title" 參數:, [widget id=”text-1″...。