默认情况下,在WordPress 后台页面的标题的尾部,都有 “—— WordPress”这一段,比如“仪表盘 < WordPress大学 —— WordPress”,有些朋友出于某些目的,需要去掉最后的 “—— WordPress”,其实方法比较简单,用到 admin_title 这个过滤挂钩。具体的代码如下:
/**
* WordPress 去除后台标题中的“—— WordPress”
* https://www.wpdaxue.com/remove-wordpress-from-admin-title.html
* 参考代码见 https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-admin/admin-header.php#L44
*/
add_filter('admin_title', 'wpdx_custom_admin_title', 10, 2);
function wpdx_custom_admin_title($admin_title, $title){
return $title.' &lsaquo; '.get_bloginfo('name');
} |
/**
* WordPress 去除后台标题中的“—— WordPress”
* https://www.wpdaxue.com/remove-wordpress-from-admin-title.html
* 参考代码见 https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-admin/admin-header.php#L44
*/
add_filter('admin_title', 'wpdx_custom_admin_title', 10, 2);
function wpdx_custom_admin_title($admin_title, $title){
return $title.' &lsaquo; '.get_bloginfo('name');
}
相关推荐:自定义 WordPress 后台底部的版权和版本信息
来源:
https://www.wpdaxue.com/remove-wordpress-from-admin-title.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_32386.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57