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.

1

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

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.