WordPress.org

Forums

how to sort the_category()? (7 posts)

  1. DominikSchwind
    Member
    Posted 12 years ago #

    Hi everybody,
    is there any way to tell the_category() in what order it is supposed to show the categories? Right now, it seems to show them in order of the id.
    If it's not possible by options, where can I mess around with the code to make it happen? I couldn't find the function the_category() in functions.php..
    Thanks in advance
    Dominik

  2. DominikSchwind
    Member
    Posted 12 years ago #

    Sure, I'm looking forward to that.

  3. lars
    Member
    Posted 12 years ago #

    Dominik, you don't need a hack to sort categories by name, which is what I asusme you want. Visit the WordPress Wiki and select "Template Tags" and scroll down to the "list_cats" function.

  4. lars
    Member
    Posted 12 years ago #

    this is what I use:
    list_cats(0,'',name);
    0 sets the option_all (show all categories) to false, replace it with a 1 or '' if you want that option on.

  5. DominikSchwind
    Member
    Posted 12 years ago #

    Actually I want the category listing for each single post sorted.
    For example, this post gets it right, (*en, Panorama) while this post doesnt. (Intern, *en)
    This is due to the fact, that Intern has the category id 1, while *en is 2 and Panorama somewhere around 5 or so. And I really can't find any way to get them sorted like in the menu, where they are sorted by name and not by category id.

  6. davidhosier
    Member
    Posted 10 years ago #

    This plugin sorts the category list outputted by the_category() in alphabetical order.

  7. FunkyDung
    Member
    Posted 10 years ago #

    Anybody know how to sort the_category() by post count?

Topic Closed

This topic has been closed to new replies.

About this Topic