隐藏wordpress后台_在WordPress中隐藏管理栏

隐藏wordpress后台

WordPress automatically injects an admin toolbar at the top of the page for logged in users.  This bar is really an annoyance to me because it slightly throws off my theme design and I never need the toolbar for anything.  Here's a snippet of code which will prevent that toolbar from displaying:

WordPress会在页面顶部自动为登录用户注入一个管理工具栏。 这个栏对我来说真的很烦,因为它稍微有点偏离我的主题设计,而且我从不需要工具栏了。 这是一段代码,将阻止该工具栏显示:


add_filter('show_admin_bar', '__return_false');


Now I don't need to hide this toolbar with CSS and my layout can look as it should. I love WordPress' filtering/hook system!

现在,我不需要使用CSS隐藏该工具栏,并且布局可以看起来像应该的那样。 我喜欢WordPress的过滤/挂钩系统!

翻译自: https://davidwalsh.name/hide-admin-bar-wordpress

隐藏wordpress后台

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值