WordPress开发教程:去除后台标题中的“—— WordPress”

前端之家收集整理的这篇文章主要介绍了WordPress开发教程:去除后台标题中的“—— WordPress”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

站长朋友们在使用以后,登录网站后台,会发现在WordPress后台页面的标题的尾部,都有 “—— WordPress”这一字段,比如“仪表盘 < 91wordpress —— WordPress”,出于某些目的,很多朋友需要去掉最后的 “—— WordPress”,其实方法比较简单,用到的是 admin_title 这个过滤挂钩。这篇里我们就来讲解一下去除方法

切换到主题目录,打开functions.PHP文件,加入以下代码

Crayon-5c891cebf0985765511382" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">functions.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-mixed-highlight" title="Contains Mixed Languages">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891cebf0985765511382-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cebf0985765511382-2">2
Crayon-num" data-line="Crayon-5c891cebf0985765511382-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cebf0985765511382-4">4
Crayon-num" data-line="Crayon-5c891cebf0985765511382-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cebf0985765511382-6">6
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891cebf0985765511382-1">Crayon-ta">PHP
Crayon-line Crayon-striped-line" id="Crayon-5c891cebf0985765511382-2">Crayon-h"> Crayon-e">add_filterCrayon-sy">(Crayon-s">'admin_title'Crayon-sy">,Crayon-h"> Crayon-s">'wp_custom_admin_title'Crayon-sy">,Crayon-h"> Crayon-cn">10Crayon-sy">,Crayon-h"> Crayon-cn">2Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891cebf0985765511382-3">Crayon-h"> Crayon-t">functionCrayon-h"> Crayon-e">wp_custom_admin_titleCrayon-sy">(Crayon-v">$admin_titleCrayon-sy">,Crayon-h"> Crayon-v">$titleCrayon-sy">)Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891cebf0985765511382-4">Crayon-h"> Crayon-k ">returnCrayon-h"> Crayon-v">$titleCrayon-sy">.Crayon-s">' &lsaquo; 'Crayon-sy">.Crayon-e">get_bloginfoCrayon-sy">(Crayon-s">'name'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891cebf0985765511382-5">Crayon-h"> Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891cebf0985765511382-6">

原文链接:https://www.f2er.com/wordpress/238413.html

猜你在找的wordpress相关文章