Creating a linkable category list with post count

I am trying to create a new education site that has two types of resources, courses and informal learning. I am trying to do this without using custom post types or taxonomies. The site with use the same topic categories for both the courses and informal learning, but each post will be identified as a course or information learning.

I'm trying to create a list of links to specific topic categories with the number of post in each, but only for courses. I want to use the category name identified by ID#. and I want to exclude informal learning from the linked results.

I could not identify an open source plugin to do this and I'm not really a coder. Any suggestions would help a lot.

Topic link-category categories Wordpress

Category Web


  1. Wordpress does this by itself as one of the widgets created. Just add the categories widget to a sidebar or wherever you want and presto, job done!

  2. If you need a more customized solution you'll need to do a bit of coding.

what you want though is wp_list_categories() function.

<ul>
    <?php wp_list_categories( array(
        'orderby'    => 'name',
        'show_count' => true,  //adds count of posts per category
        'include'    => array( 10 )  //only includes category with ID 10
    ) ); ?> 
</ul>

see this link for reference: https://developer.wordpress.org/reference/functions/wp_list_categories/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.