How to sort categories by slug! (4 posts)

  1. vefritid
    Posted 9 years ago #

    I'm writing a page in Icelandic and having problems with sorting the categories in alphabetical order, because special characters lika Á, É, Ó, Æ og Þ all come before A, when á use sort_column=name.... is there any way to sort the categories by the category slug - that is the only way I've found to solve my problem!

    I've also encountered the same problem when I sort authors in alphabetical order, but was able to solve that (although in a very crude way).

    Any help is appreciated!


  2. vefritid
    Posted 9 years ago #


  3. Chris_K
    Posted 9 years ago #

    I don't have your answer, but I have some suggested reading that may be helpful.

    You may want to look at the query_posts() template tag: http://codex.wordpress.org/Template_Tags/query_posts

    This one discusses "order by" with query_posts: http://ifelse.co.uk/archives/2005/04/08/query_posts-redux/

    And finally, this may be of use as well: Displaying_Posts_Using_a_Custom_Select_Query

  4. vefritid
    Posted 9 years ago #

    Thanks for the reply Han... but I still haven't found what I'm looking for.

    It's very strange that it isn't possible to call the slug variable in the

    '<?php wp_list_cats('sort_column=name&optioncount=1'); ?>'

    function. If for example I called a category "Music" but gave it the slug "audio" it could always sort by M. This is a big problem for me as I have some icelandic characters that wont sort correctly in the alphabet.

Topic Closed

This topic has been closed to new replies.

About this Topic