如何徹底移除WordPress前端管理工具列

來源:互聯網
上載者:User

仲介交易 HTTP://www.aliyun.com/zixun/aggregation/6858.html">SEO診斷 淘寶客 雲主機 技術大廳

顯然,大多數的WordPress使用者不喜歡看到網站前端的WordPress管理欄面板,當然也有很多去除前端管理面板的方法,比如之前WPMEE在這篇文章仲介紹過的方法:如何在管理工具列添加自訂連結, 其中就涉及到如何移出前端管理工具列,然而,他們只是禁用了管理欄,使管理欄的display:none,並沒有將其中的JS,CSS完全移出。 這裡我們將告訴大家如何完全的移出wordpress前端管理工具列包括JS,CSS代碼等。

將下面的代碼放到你主題的functions.php中就可以完全移出wordpress前端管理工具列:

Disable Admin Bar,www.wpmee.com

if (!function_exists('df_disable_admin_bar')) { function df_disable_admin_bar() { // for the admin page remove_action('ad min_footer', 'wp_admin_bar_render', 1000); for the front-end remove_action('wp_footer', 'wp_admin_bar_render', 1000); css override for the admin page function remove_admin_bar_style_backend() { echo ''; } add_filter('admin_head','remove_ admin_bar_style_backend'); css override for the frontend function remove_admin_bar_style_frontend() { echo ''; } add_filter('wp_head','remove_admi n_bar_style_frontend', 99); } } add_action('init','df_disable_admin_bar');

好了,刷新下網頁,看看管理面板使用的CSS已經JS是不是都沒有了?尊重他人勞動成果,轉載請注明:HTTP://www.wpmee.com/remove-admin-bar/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.