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.

1 Answer 1

  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.

    <?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
    ) ); ?> 

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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