Support » Fixing WordPress » Category Sort by Slug

  • 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    Forum Moderator

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

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

    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.

    esmi

    (@esmi)

    Forum Moderator

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category Sort by Slug’ is closed to new replies.