/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $selected = ' selected="selected"'; ?> <select name="<?php $metabox->the_name(); ?>"> <?php $terms = get_terms('property-location', 'orderby=name&hide_empty=0'); foreach ($terms as $taxindex => $taxitem) { echo '<option value="'. $taxitem->ID .'"'; $thevalue = $taxitem->ID; if ($metabox->get_the_value() == "$thevalue") echo $selected; ?> <?php echo '>' . $taxitem->name .'</option>'; } ?> </select>