Posted by: Vincent on: March 24, 2011
If you want to list your posts and order them by title, that is as simple as:
query_posts('orderby=title')
But if you are using international characters and/or another alphabet the default database settings may mess things up for you.
In Sweden for example, the last the letters in the alphabet are Å, Ä, Ö. So accordingly, posts with titles starting with those letters should come last in an ascending list, but by default ‘Å’ and ‘Ä’ will be considered as ‘A’ and ‘Ö’ as ‘O’ .
But there’s an easy fix for this. Simply change the collation of the post_title column.
Execute the following SQL query. Remember to back up your database before, just to be safe!
ALTER TABLE wp_posts CHANGE post_title post_title TEXT CHARACTER SET utf8 COLLATE utf8_swedish_ci;
This will give your post_title column a Swedish collation, so please change to your desired collation.
July 12, 2011 at 8:21 am
Bra att du tar upp det här problemet. För mig uppstår det när jag vill visa en länklista i bokstavsordning, med hjälp av WP-Render-Blogroll-Links.
Kan du berätta vart man ska göra det du föreslår här ovan, för mig som inte är så hi på kodning…