Post Subcategories
-
I am trying to only show the year sub categories. Every array I try does nothing or breaks the page. I want to have several drop downs that send the user to that category when selecting the year (as an example)
Any help of where I am going wrong would be appreciated.
<select name=”event-dropdown” onchange=’document.location.href=this.options[this.selectedIndex].value;’>
<option value=””><?php echo esc_attr(__(‘Select Category’)); ?></option><?php
$categories = get_categories();
foreach ($categories as $category) {$args = array(
‘cat’ => $catid,
‘post_type’ => ‘fallen-year’
);
$option .= ‘<option value=”‘.get_option(‘home’).’/category/’.$category->slug.'”>’;
$option .= $category->cat_name;
$option .= ‘ (‘.$category->category_count.’)’;
$option .= ‘</option>’;
}
echo $option;
?>
</select>The page I need help with: [log in to see the link]
- The topic ‘Post Subcategories’ is closed to new replies.