Return to Snippet

Revision: 31816
at September 14, 2010 05:36 by jayberz


Initial Code
<?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>

Initial URL

                                

Initial Description

                                

Initial Title
Select Box for WP Alchemy/Taxonomy

Initial Tags

                                

Initial Language
PHP