Posted By

jayberz on 09/14/10


Tagged


Versions (?)

Select Box for WP Alchemy/Taxonomy


 / Published in: PHP
 

  1. <?php $selected = ' selected="selected"'; ?>
  2. <select name="<?php $metabox->the_name(); ?>">
  3. <?php $terms = get_terms('property-location', 'orderby=name&hide_empty=0');
  4. foreach ($terms as $taxindex => $taxitem) {
  5. echo '<option value="'. $taxitem->ID .'"'; $thevalue = $taxitem->ID; if ($metabox->get_the_value() == "$thevalue") echo $selected; ?>
  6. <?php echo '>' . $taxitem->name .'</option>';
  7. }
  8. ?>
  9. </select>

Report this snippet  

You need to login to post a comment.