最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

categories - Category list with postcount

programmeradmin0浏览0评论

Im total noob with wordpress, and would like to get some help with following problem.

I Would like to make list of all categories and postcounts in category, something like this:

category1(2), category2(4), category3(7)

with hyperlinks to the category page. If someone could help me with this one with noob friendly answer i would appreciate it so much.

Im total noob with wordpress, and would like to get some help with following problem.

I Would like to make list of all categories and postcounts in category, something like this:

category1(2), category2(4), category3(7)

with hyperlinks to the category page. If someone could help me with this one with noob friendly answer i would appreciate it so much.

Share Improve this question asked May 20, 2019 at 17:38 user595846user595846 32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You just need to use wp_list_categories function with param show_count set to true

https://developer.wordpress/reference/functions/wp_list_categories/

wp_list_categories( array(
'show_count' => true,
'title_li' => '<h2>' . __( 'Categories', 'textdomain' ) . '</h2>') );
发布评论

评论列表(0)

  1. 暂无评论