I'm trying to use the following example from the codex that creates a dropdown list of categories:
<select name="event-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
<option value=""><?php echo attribute_escape(__('Select Event')); ?></option>
<?php
$categories= get_categories('child_of=10');
foreach ($categories as $cat) {
$option = '<option value="/category/archives/'.$cat->category_nicename.'">';
$option .= $cat->cat_name;
$option .= ' ('.$cat->category_count.')';
$option .= '</option>';
echo $option;
}
?>
</select>
But instead of 'child_of=10' I want it to list the child categories of the current category being queried. I see how to get the single title with single_cat_title()...is there something similar to get the category id? Thanks!