[WordPress] 外掛分享: List categories

WordPress 外掛 List categories 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「List categories」是 2014-06-25 上架。
  • 目前有 6000 個安裝啟用數。
  • 上一次更新是 2024-05-30,距離現在已有 338 天。
  • 外掛最低要求 WordPress 3.3 以上版本才可以安裝。
  • 有 15 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

fernandobt |

外掛標籤

cms | list | categories |

內容簡介

這是一個簡單的外掛程式,可以透過簡碼在任何文章或頁面中顯示類別。它基本上是一個簡碼 API 介面,用於 WordPress 的 wp_list_categories 函數。這表示,根據該函數接受的任何參數,都可以將其作為簡碼參數傳遞給「categories」簡碼。

使用方式:

[categories orderby=count]

將顯示所有類別的連結,按每個類別中的文章數量進行排序。

您還可以列出標籤或任何其他 WordPress 稅類。您需要將值傳遞給「taxonomy」參數。例如,要列出標籤:「[categories taxonomy=post_tag title_li="Tags"]。」
默認情況下,使用情況顯示:

不顯示所有類別的連結
按類別名稱升序排序類別列表
顯示無序列表風格
不顯示文章數量
僅顯示有文章的類別
將 title 屬性設置為類別描述
未限制到任何子類別
未使用餵料或餵料圖像
不排除任何類別,包括所有類別
使用 CSS 類後綴「current-cat」顯示活躍的類別
以階層縮進方式顯示類別
將類別顯示為列表標題
不受 SQL 限制(上述未顯示「number」= 0)
顯示(回聲)類別
深度無限制
所有類別。
使用新的 Walker_Category 類的遍歷對象呈現列表

有關用法,請參見wp_list_categories。

類別列表的標記和樣式

從wp_list_categories 官方文檔中獲取。

默認情況下,wp_list_categories() 會在單個列表項目(li)內生成嵌套的無序列表(ul),標題為「類別」。

您可以通過將 title_li 參數設置為空字符串來刪除最外層的項目和列表。您需要自己將輸出包裝在有序列表(ol)或無序列表中(請參閱上面的示例)。如果您不想要列表輸出,請將 style 參數設置為 none。

您可以使用以下 CSS 選擇器設置輸出的樣式:

li.categories { ... } /* 最外層列表項目 */
li.cat-item { ... }
li.cat-item-7 { ... } /* 類別 ID #7,等 */
li.current-cat { ... }
li.current-cat-parent { ... }
ul.children { ... }

在列中顯示類別列表

要將列表輸出為列,您可以使用CSS 的多列。由於默認情況下,列表被列印為帶有「categories」類的無序列表,因此您可以將其添加到您的 CSS 中:

.categories{
column-count: 5;
column-gap: 50px;
}

原文外掛簡介

Simple plugin to display categories in any post or page with a shortcode. It’s basically a shortcode API interface to the wp_list_categories WordPress function. This means given any of the parameters accepted by the function, you can pass it in as a shortcode parameter to the categories shortcode.
Usage:
[categories orderby=count]

Will display links to all the categories and order them by number of posts in each category.
You can also list tags or any other WordPress taxonomy. You need to pass a value to the taxonomy parameter. For example to list tags: [categories taxonomy=post_tag title_li="Tags"].
By default, the usage shows:

No link to all categories
Sorts the list of Categories by the Category name in ascending order
Displayed in an unordered list style
Does not show the post count
Displays only Categories with posts
Sets the title attribute to the Category Description
Is not restricted to the child_of any Category
No feed or feed image used
Does not exclude any Category and includes all Categories
Displays the active Category with the CSS Class-Suffix ‘ current-cat’
Shows the Categories in hierarchical indented fashion
Display Category as the heading over the list
No SQL LIMIT is imposed (‘number’ => 0 is not shown above)
Displays (echos) the categories
No limit to depth
All categories.
The list is rendered using a new walker object of the the Walker_Category class

See wp_list_categories for usage.
Markup and Styling of Category Lists
Taken from the wp_list_categories official documentation.
By default, wp_list_categories() generates nested unordered lists (ul) within a single list item (li) titled “Categories”.
You can remove the outermost item and list by setting the title_li parameter to an empty string. You’ll need to wrap the output in an ordered list (ol) or unordered list yourself (see the examples above). If you don’t want list output at all, set the style parameter to none.
You can style the output with these CSS selectors :
li.categories { ... } /* outermost list item */
li.cat-item { ... }
li.cat-item-7 { ... } /* category ID , etc */
li.current-cat { ... }
li.current-cat-parent { ... }
ul.children { ... }

Show categories list in columns
For outputting the list into columns, you can use CSS’s multicolumns. Since by default the list is printed as an unordered list with the “categories” class, you can add this to your CSS:
.categories{
column-count: 5;
column-gap: 50px;
}

各版本下載點

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

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


0.1 | 0.2 | 0.3 | 0.4 | 0.5 | trunk |

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

  • List category posts 》List Category Posts 可以讓你透過使用 [catlist] 短碼在文章或頁面中按類別列出文章。在編輯頁面或文章時,直接插入短碼到文章中,文章就會被列出來。基本的...。
  • Media Library Assistant 》媒體庫助手提供多個增強功能,方便管理媒體庫,其中包括:, , , , [mla_gallery] 短碼,在文章、頁面或自訂文章類型中使用,添加圖片和/或其他媒體庫項目(...。
  • WordPress Tag, Category, and Taxonomy Manager – AI Autotagger 》axoPress allows you to show a customizable display of the terms assigned to the current post. You can choose which taxonomy and which format to dis...。
  • Remove Category URL 》這個外掛可以徹底將 WordPress 網站的連結結構中的「/category/」去除(例如:從 mydomain.com/category/my-category/ 變成 mydomain.com/my-category/ )。,...。
  • Category Posts Widget 》Category Posts Widget是一個輕巧的小工具,設計用於一件事並且做得很好:顯示特定類別中最新的文章。, 基於詞語和類別的文章小工具, 這個免費小工具的高級版...。
  • Media Library Categories 》此外掛可允許在 WordPress 媒體庫中使用分類。啟用後,媒體庫中會顯示下拉式的分類清單。, 您可以使用大量動作進行多項目的分類更改、新增或移除分類。, 在使...。
  • Visual Term Description Editor 》此外掛會將分類說明編輯器替換成WordPress TinyMCE視覺編輯器,讓您可以在分類說明裡使用 HTML 並以豐富文字方式撰寫。此功能支援所有分類法,如標籤、分類、...。
  • Post Tags and Categories for Pages 》將文章標籤與分類套件套用於所有頁面,讓您可以使用 WordPress 原生的分類功能來分類您的頁面,並且會顯示在 WordPress 存檔查詢裡。, 這個外掛並不會自動顯...。
  • FV Top Level Categories 》這是針對 WordPress 3.1 及以上版本修復「Top Level Category」外掛程式的修正版。此外掛程式的目的是提供和原來程式相同的功能,但在新版本的 WordPress 上...。
  • Hide Categories and Products for Woocommerce 》這個外掛可以讓你隱藏選定的類別上的店鋪產品,並隱藏類別本身,無論是在列表還是單獨頁面中。, 它可以與 Storefront(主題)短代碼兼容。, 使用方式, , 前往...。
  • Flexible Posts Widget 》預設近期文章小工具非常簡單。我常常需要一個簡單的方法,能夠輕鬆地顯示任意文章類型或分類法的文章精選內容。這就是彈性文章小工具的由來。, 彈性文章小工...。
  • Essential Widgets 》Essential Widgets 是一款免費的 WordPress 插件,專門用於小工具,可以讓您在網站上創建和添加有趣的小工具,使其更具吸引力和親和力。Essential Widgets 忠...。
  • Category Tag Pages 》為您的頁面添加類別和標籤功能。, 此外掛會添加「post_tag」和「category」taxonomy (標籤和分類所使用的現有taxonomy名稱) 到「page」文章型別 (Post type) ...。
  • BulkPress 》在 WordPress 中加入多個分類可能非常麻煩。如果你想要為世界上每個國家添加分類,那麼填寫並提交新分類表單數百次就是一件非常糟糕的工作,尤其是當你添加具...。
  • Allow HTML in Category Descriptions 》當您在類別描述文本區添加文字並保存類別時,WordPress會運行內容過濾器,剝除除最基本格式標籤以外的所有內容。, 這個外掛程式可以禁用具有必要權限的角色的...。

文章
Filter
Apply Filters
Mastodon