WordPress.org

Support

Support » How-To and Troubleshooting » How can I display only the most popular categories?

How can I display only the most popular categories?

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

    Thanks for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    Regards

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

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I display only the most popular categories?’ is closed to new replies.
Skip to toolbar