php - Wordpress - Alphabetically Order Taxonomies (get_taxonomy) -
i have following code outputting categories have drop-down. i'm trying alphabetically order these categories in drop-down make easier users find them.
<?php // output dropdown each taxonomy // foreach ($taxonomies $tax) { ?> <div id="<?php echo $tax . '_cat'; ?>"> <label for="wppl-category-id"><?php echo get_taxonomy($tax)->labels->singular_name; ?>: </label> <?php custom_taxonomy_dropdown($tax); ?> </div> <?php } /* end foreach */ ?>
i looked , seems get_taxonomy has no orderby options (at least find). there suggestions how this?
thanks!
maybe can check native function get_terms?
it has orderby argument , believe can order them name.
there example there, if replace count name this:
$categories = get_terms( 'category', 'orderby=name' );
Comments
Post a Comment