金斤 發表於 2023-10-14 00:00:00

wordpress去掉自带的logo或者左侧栏的菜单方法

<p>
<span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>去掉logo或者左侧栏的菜单,防止被改掉。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>在使用模板下的functions.php下修改 </span></p>
<div style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<p style="margin: 0px; padding: 0px; outline: none; float: right; line-height: 25.2px; font-size: 14px;">
<span style="line-height: 25.2px; cursor: pointer;"><u>复制代码</u></span></p>
<p>
代码如下:</p>
</div>
<p style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
function my_edit_toolbar($wp_toolbar) { <br>
$wp_toolbar-&gt;remove_node('wp-logo'); //去掉Wordpress LOGO <br>
$wp_toolbar-&gt;remove_node('site-name'); //去掉网站名称 <br>
$wp_toolbar-&gt;remove_node('updates'); //去掉更新提醒 <br>
$wp_toolbar-&gt;remove_node('comments'); //去掉评论提醒 <br>
$wp_toolbar-&gt;remove_node('new-content'); //去掉新建文件 <br>
$wp_toolbar-&gt;remove_node('top-secondary'); //用户信息 <br>
} <br>
add_action('admin_bar_menu', 'my_edit_toolbar', 999); </p>
<p>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>去掉后台登陆字体的 wordpress的话,在wop-admin下的admin-footer.php文件件下修改 </span></p>
<div style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<p style="margin: 0px; padding: 0px; outline: none; float: right; line-height: 25.2px; font-size: 14px;">
<span style="line-height: 25.2px; cursor: pointer;"><u>复制代码</u></span></p>
<p>
代码如下:</p>
</div>
<p style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
&lt;p id="footer-left"&gt; <br>
&lt;?php <br>
/** <br>
* Filter the "Thank you" text displayed in the admin footer. <br>
* <br>
* @since 2.8.0 <br>
* @param string The content that will be printed. <br>
*/ <br>
echo apply_filters( 'admin_footer_text', '&lt;span id="footer-thankyou"&gt;' . __( 'Thank you for creating with &lt;a href="http://ym-in.com/"&gt;yuemei&lt;/a&gt;.' ) . '&lt;/span&gt;' ); <br>
?&gt; <br>
&lt;/p&gt; </p>
頁: [1]
查看完整版本: wordpress去掉自带的logo或者左侧栏的菜单方法