內容簡介
該外掛提供一個簡短代碼來計算符合一組特定條件的文章數量,同時提供一個連結到列出符合條件的文章的查詢頁面。
這個外掛可以運用在內置文章類型(頁面、文章)和分類(標籤、分類),以及自定義文章類型和自定義分類上。
範例
你有一個叫做車的自定義文章類型,並想要計算庫存中所有紅色車的數量,同時提供一個連結列出這些車。
庫存中的紅色車輛: [count color=red]
會回傳車的數量以及一個鏈接到yoursite.com/?color=red(可能會根據你的固定連接結構進行重寫)。
使用方法
在你的文章中插入一個簡短代碼,格式為[count {taxonomy}={value}]。你可以添加任意数量的分類。
你也可以使用post_type參數來指定一種文章類型(頁面、文章、車等)。
列表使用方法
你可以計算某個分類的所有標籤,例如 [list-counts taxonomy=”tags”] 或跨越所有分類 [list-counts]。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Shortcode to count number of posts that match a given set of criteria; provides link to query to display list of matching posts.
Works with both built in post types (pages, posts) and taxonomies (tags, categories), as well as custom post types and custom taxonomies.
Example
You have a car custom post type and would like a count of all the red cars in your inventory, as well as a link to a listing of those cars.
Red Cars in Inventory: [count color=red]
Would return the number of cars, as well as a link to yoursite.com/?color=red (which may rewrite depending on your permalink structure)
Usage
Insert a shortcode in your post in the form of [count {taxonomy}={value}]. You can add as many or as fiew taxonomies as you would like.
You can also use the post_type argument to specify a post type (page, post, car, etc.)
List Usage
You can count all terms within a taxonomy, e.g., [list-counts taxonomy=”tags”] or across all taxonomies [list-counts].
