Im setting up a custom template, working on options for the admin and i would like to add a combobox to pick up a category. Something like: Editor's Pick Category: []
I already know how to add options to the panel, but not something like a category that comes from wordpress itself.
Thanks for any tips
To add a select option with pre populated fields you would first grab all of the categories from your blog then store it in an array.
// Grabs Categories from Wordpress
$tt_categories = array();
$tt_categories_obj = get_categories('hide_empty=0');
foreach ($tt_categories_obj as $tt_cat) {
$tt_categories[$tt_cat->cat_ID] = $tt_cat->cat_name;}
$categories_tmp = array_unshift($tt_categories, "Select a category:");
Then you would call it like so in your theme options
//shows a select box in theme options page
$options[] = array( "name" => __('Wordpress Category','framework_localize'),
"desc" => __('Select a category','framework_localize'),
"id" => "wp_category",
"std" => "1",
"type" => "select",
"options" => $tt_categories);