Skip to content

Instantly share code, notes, and snippets.

@imjjss
Created February 23, 2012 09:19
Show Gist options
  • Save imjjss/1891859 to your computer and use it in GitHub Desktop.
Save imjjss/1891859 to your computer and use it in GitHub Desktop.
taxonomy dropdown
<p><?php $syntax = get_object_taxonomies('snip');
$syntaxterms=get_terms($syntax, 'orderby=count&offset=1&hide_empty=0&fields=all');
// var_dump($syntaxterms); die; ?>
<select name='syntax' id='syntax' tabindex="4">
<option value='' <?php if (!count( $names )) echo "selected";?>>Select syntax</option>
<?php foreach ( $syntaxterms as $code ) { echo '<option value="' . $code->slug . '" selected>' . $code->name . '</option>',"\n"; } ?>
</select></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment