Title: Styling Sidebar Widget Dropdowns
Last modified: August 20, 2016

---

# Styling Sidebar Widget Dropdowns

 *  [mgwaters](https://wordpress.org/support/users/mgwaters/)
 * (@mgwaters)
 * [15 years ago](https://wordpress.org/support/topic/styling-sidebar-widget-dropdowns/)
 * Hello,
 * I’m trying to style the default dropdown widgets for both “categories” and “archives”.
   I would like to suppress the title (which I know how to do) and change the default“
   select category” to instead by the title of the dropdown, which in the default
   WordPress instance would be “Categories”. I actually want to use a completely
   different term “sections” instead of categories. Pretty sure I can style the 
   look of the dropdown items, but wasn’t sure how to replace the “Select Category”
   with the term “sections”
    For a visual of what I’m trying to do: [http://www.studio678.com/images/dropdownScreenGrabs.gif](http://www.studio678.com/images/dropdownScreenGrabs.gif)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [15 years ago](https://wordpress.org/support/topic/styling-sidebar-widget-dropdowns/#post-2144866)
 * Instead of using widgets, you might want to simply change the code of your sidebar.
   php.
 * See an example of how to do this [on the Codex](http://codex.wordpress.org/Function_Reference/get_categories#Dropdown_Box_as_used_in_Parent_category_at_post_category_page).
 *  Thread Starter [mgwaters](https://wordpress.org/support/users/mgwaters/)
 * (@mgwaters)
 * [15 years ago](https://wordpress.org/support/topic/styling-sidebar-widget-dropdowns/#post-2144869)
 * Well, I want the dropdown to appear in the header, so I created a widget for 
   the header and used the categories and archives widgets there. I suppose the 
   same logic applies though? I’m not a heavy programmer, is there a reason you 
   suggest the method outlined in the Codex?
 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [15 years ago](https://wordpress.org/support/topic/styling-sidebar-widget-dropdowns/#post-2144870)
 * With the method in the codex, you can edit the text –
 *     ```
       <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 $category) {
         	$option = '<option value="/category/archives/'.$category->category_nicename.'">';
       	$option .= $category->cat_name;
       	$option .= ' ('.$category->category_count.')';
       	$option .= '</option>';
       	echo $option;
         }
        ?>
       </select>
       ```
   
 * In the example above they have select event.. So you could have sections….
 * I’m not sure how the widget code is generated. There might be a filter you can
   apply, but either way it involves some coding.
 *  Thread Starter [mgwaters](https://wordpress.org/support/users/mgwaters/)
 * (@mgwaters)
 * [15 years ago](https://wordpress.org/support/topic/styling-sidebar-widget-dropdowns/#post-2144871)
 * Thank you for your help I appreciate it. I see that this `<?php wp_get_archives(
   $args ); ?>` spits out a list of archives. Do I need something similar to populate
   the drop down list with my categories? This is to go on every page of the site,
   so both pages and posts.
 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [15 years ago](https://wordpress.org/support/topic/styling-sidebar-widget-dropdowns/#post-2144916)
 * Have a look in the codex – [http://codex.wordpress.org/Template_Tags/wp_get_archives](http://codex.wordpress.org/Template_Tags/wp_get_archives)
 * There’s some example code in there.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Styling Sidebar Widget Dropdowns’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [dropdown](https://wordpress.org/support/topic-tag/dropdown/)
 * [style](https://wordpress.org/support/topic-tag/style/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 5 replies
 * 2 participants
 * Last reply from: [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/styling-sidebar-widget-dropdowns/#post-2144916)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
