How can I display only the most popular categories? (4 posts)

  1. Chuy Sánchez
    Posted 10 years ago #

    I just want to display a list of 10 categories, the most popular, I mean, the categories with more posts.

    Thanks for your help.

  2. Cypher
    Posted 10 years ago #

    It is entirely likely that you'll have to change the functionality of wp_list_cats. Look at /wp-includes/template-functions-category.php.

    There is an option that allows you to hide empty categories, so the code is already counting the number of posts in each category. You'll have to augment that portion of the code to determine the top 10 categories there and return/list them.


  3. Chuy Sánchez
    Posted 10 years ago #

    Hi. I'll edit function wp_list_cats. Thanks for your help.

  4. ClimbingMonkey
    Posted 10 years ago #

    I would love to hear how this is done and if you can get it to work. I could also use something like this and I will check out the code as well.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.