WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have list of terms which happens to be the Polish Alphabet.

Here's how I list these terms:

   $terms = get_terms("taxonomy", array('orderby' => 'title', 'hide_empty' => 0));
   foreach ( $terms as $term ) {
      echo "<li><a href='". get_term_link( $term->slug, $term->taxonomy ) ."'>" . $term->name . "</a></li>";
   } ?>  

Everything works like a charm excepting one thing - the letter that is supposed to be after "L" ("Ł") is always the last element o that list (so it's after "Ż", not "L"). Is there any way to fix it? I've been trying multiple WP versions including Polish builds.

Any ideas? I can always do two foreach loops for A-L and M-Ż and add that one between them, but would love to do that with more class.

share|improve this question

You need to set the database collation to utf8_polish_ci in your wp-config.php to get correct sorting.

share|improve this answer
I set define('DB_COLLATE', 'utf8_polish_ci'); in wp-config.php but it doesn't seem to help, the letter is still the very last one. – stillanonymous123 Oct 17 '12 at 18:45
@stillanonymous123 You might have to run an ALTER TABLE. – toscho Oct 17 '12 at 18:51
As far as I understand I have to update my tables (all of them or just wp_terms?) using ALTER TABLE wp_terms CONVERT TO CHARACTER SET charset? utf8_polish_ci is not a charset according to mysql manual so which one should I use? Thanks a lot! – stillanonymous123 Oct 17 '12 at 19:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.