Follow @BPSPro

WordPress – Change Category Widget Dropdown List Select Name

11 Comments RSS Site Feed Author: AITpro Admin
Published: May 22, 2010
Updated: May 22, 2010

To change the category widget dropdown list select name in WordPress you will need to modify the /wp-includes/default-widgets.php WordPress file.  The default select name or option value name for the category dropdown widget is “Select Category”.

The line of code you are looking for in the default-widgets.php file is code line 440 in WordPress 2.9.1 and WordPress 2.9.2.  I’m not sure if that code line is different for previous versions of WordPress, but the default-widgets.php file is the file you will need to modify in any case.

Here is what the code looks like at line 44o in default-widgets.php:

/wp-includes/default-widgets.php – Code Line 440

This example is showing that “Select Category” has been changed to “Select Products and Services”.

if ( $d ) {

$cat_args[‘show_option_none’] = __(‘Select Products and Services’);

wp_dropdown_categories(apply_filters(‘widget_categories_dropdown_args’, $cat_args));

Download the default-widgets.php WordPress file, change the category dropdown select name to whatever you want and upload it back to the /wp-includes WordPress folder.

On a personal note I searched high and low for this answer and did not find it out there so hopefully this will be easily found by anyone who wants to modify their category dropdown widget select name.

To change the CSS style for the category widget dropdown list you would add whatever CSS code you want in your WordPress theme’s style.css file.  The CSS class name for the category dropdown list is “postform”.  You may or may not see this CSS class on your particular WordPress theme style.css file so you may need to add it.

This example shows the .postform CSS class with a background color and set to a width of 240px:

.postform {background-color: #CCCCCC; width:240px;}

Skip to toolbar