[英]Change default “Select Category” text in categories dropdown widget in WordPress
WordPress中的默认下拉类别小部件默认情况下将文本“选择类别”显示为第一个选项,是否有一种简单的方法来更改此文本而无需使用插件或修改核心WordPress文件?
Add a function like this one in your functions.php
in the stylesheet directory: 在stylesheet目录的
functions.php
中添加一个类似这样的functions.php
:
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
我的类别是您想要的新标题,而不是
Select Category
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.