Skip to content

Instantly share code, notes, and snippets.

@designbuildtest
Created August 10, 2016 04:42
Show Gist options
  • Save designbuildtest/a8b77745966e2aba68aee15bab24e902 to your computer and use it in GitHub Desktop.
Save designbuildtest/a8b77745966e2aba68aee15bab24e902 to your computer and use it in GitHub Desktop.
$args = array(
'show_option_all' => __( 'Select a category', 'inmyarea' ),
//'show_option_none' => '',
//'option_none_value' => '-1',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
'selected' => $cat,
'hierarchical' => 1,
'name' => 'browse',
'id' => 'browse',
'class' => 'browse',
'taxonomy' => 'category',
'hide_if_empty' => false,
'value_field' => 'term_id',
);
wp_dropdown_categories( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment