We’ve set up drop down lists to allow people to filter posts based on custom post types.
In order to populate the drop down list I am using:
<?php $terms = get_terms("ratios");
$count = count($terms);
if ( $count > 0 ){
foreach ( $terms as $term ) {
echo "<option value="" . $term->slug . "">" . $term->name . "</option>";
}
}?>
</select>
The slug and the name are pretty similar, so I don’t mind which one we are using.
How can I list them as integers?
The site is here if you need more of an idea: http://amigaeng.com.au/gearbox-list/