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 the selected option saved correctly, but when load the page, wp_dropdown_categories still load the list by its order. I prefer to load the selected item on top. How to do this?

share|improve this question
up vote 0 down vote accepted

if the currently selected item has some type of identifier on it (maybe class="current") you may be able to use some jquery to grab it's value, hide it, then move it to the top.

<div class="topdiv">
this is top div

<li class="current">2</li>

(function() { var top = $('.current').html(); $('.current').hide(); $('.topdiv').text(top); })();

this worked in testing

share|improve this answer
Thanks for the code! I've figured out that wp cat dropdown is not convinient. I will code the select box myself. But I will apply your code on other places that need move. – Jenny Aug 29 '12 at 0:22

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.