Sorry if this is a silly question but is it possible to have a taglist as a dropdown?

I have a page where users can post theyre own content, and I would like them to be able to choose certain tags as a dropdown, is this possible?

Heres the page so you can see http://wordpress.art-williams.com/add-destination

I appreciate any help what so ever, anything is a huge help!



You can use wp_dropdown_categories() to create your dropdown:

wp_dropdown_categories(array('taxonomy'=> 'post_tag','hide_empty' => 0, 'name' => 'my_tags'));


the reason you are getting the term ID is because wp_dropdown_categories sets the ID's as values so instead of just echo'ing it out you need to get the term, something like:

$term = get_term_by('id',$your_id,'post_tag');
echo $term->name;
  • Oh wow you are a genius! :) Thank you, if I wanted to exclude a tag from that list, would I just need to put in 'exclude=ID' ? – Art Aug 16 '11 at 14:19
  • @art: yep just add exclude with id to the array. – Bainternet Aug 16 '11 at 14:25
  • Ok sorry i have tried this wp_dropdown_categories(array('taxonomy'=> 'post_tag','exclude=6', 'hide_empty' => 0, 'name' => 'my_tags')); and it isnt working – Art Aug 16 '11 at 14:29
  • because its wrong syntax, change'exclude=6' to 'exclude'=>6 – Bainternet Aug 16 '11 at 14:51
  • Glad I could help. – Bainternet Aug 16 '11 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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