WordPress.org

Ready to get started?Download WordPress

Forums

List categories in order of post count (5 posts)

  1. ChristopherO
    Member
    Posted 7 years ago #

    Ok so to order categories by name you do this;
    wp_list_cats('sort_column=name')

    In the database table, the fields are called cat_name and cat_id. so wp_list_cats add a prefix of 'cat_' to whatever you pass in to this function.

    So how can you order them by the number of posts?

    Passing in 'category_count' brings up an unknown error as column 'cat_category_count' is missing. Just using 'count' obviously doesn't work either.

    Any ideas?
    Thanks

  2. ChristopherO
    Member
    Posted 7 years ago #

    bump (sorry)

  3. ChristopherO
    Member
    Posted 7 years ago #

    Hmm, has no-one wanted to do this before?

  4. ChristopherO
    Member
    Posted 7 years ago #

    bump

  5. ChristopherO
    Member
    Posted 7 years ago #

    Ok I found this, but it only lets you manually order categories, not just list then in order of number of posts in the categories
    http://www.geekyweekly.com/mycategoryorder

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags