I am tyring to add a category drop down list to my theme options page. I am try it this way:
<p>
Select a style from the list
<?php
$amp_categories_obj = get_categories('hide_empty=0');
$amp_categories = array();
foreach ($amp_categories_obj as $amp_cat) {
$amp_categories[$amp_cat->cat_ID] = $amp_cat->category_nicename;
}
$categories_tmp = array_unshift($amp_categories, "Select a category:");
echo "<select name='amp_options[amp_cat]'>";
foreach ($amp_categories_obj as $amp_cat) {
$selected = ($options['amp_cat']==$amp_cat) ? 'selected="selected"' : '';
echo "<option value='$amp_cat' $selected>$amp_cat</option>";
}
echo "</select>";
?>
</p>
I am not much of a PHP coder by the way. Any help would be appreciated.