Hassan
Hassan

Reputation: 89

Change default "Select Category" text in categories dropdown widget in WordPress

The default dropdown categories widget in WordPress displays the text "Select Category" as a first option by default, is there a simple method to change this text without using a plugin or modifying the core WordPress file?

Upvotes: 3

Views: 5395

Answers (1)

Felipe Alameda A
Felipe Alameda A

Reputation: 11809

Add a function like this one in your functions.php in the stylesheet directory:

function ChangeSelectTitle($cat_args){
$cat_args['show_option_none'] = __('My Category');
return $cat_args;
}
add_filter('widget_categories_dropdown_args', 'ChangeSelectTitle');

Where My Category is the new title you want instead of Select Category

Upvotes: 6

Related Questions