WordPress.org

Ready to get started?Download WordPress

Forums

Category Sort by Slug (4 posts)

  1. mystifier
    Member
    Posted 3 years ago #

    How do I make Categories sort by Slug rather than Name?

    I have a logical order for Categories but they are not in alphabetical order.

    Thanks.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    <?php wp_list_categories( 'title_li&orderby=name' ); ?>

    http://codex.wordpress.org/Template_Tags/wp_list_categories

  3. mystifier
    Member
    Posted 3 years ago #

    Thanks esmi, I saw that but I don't call wp_list_categories from the template, I just add the standard Categories Widget to the sidebar which doesn't offer any sort options.

    In the end, I hacked wp-includes\default-widgets.php but I have the feeling that there should be a better solution that will survive updates.

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    A better option would be to add the necessary code to your sidebar instead of using the native Category widget. Or looking for a suitable plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.