任何人都知道如何從前端刪除管理導航鏈接?我已經構建了一個自定義主題,當我登錄到WordPress時,WordPress會在某處添加管理員導航欄。WordPress Admin Nav顯示在前端
3
A
回答
7
管理欄? 轉到用戶>您的個人資料>顯示管理欄。在這裏你可以從你的主題中禁用它。如果你想完全禁用(刪除)它,使用各種插件之一,like this。
1
或者您可以在functions.php中將其刪除。
/* Disable the Admin Bar. */
add_filter('show_admin_bar', '__return_false');
<?php function yoast_hide_admin_bar_settings() { ?>
<style type="text/css">
.show-admin-bar {
display: none;
}
</style>
<?php }
function yoast_disable_admin_bar() {
add_filter('show_admin_bar', '__return_false');
add_action('admin_print_scripts-profile.php',
'yoast_hide_admin_bar_settings');
}
add_action('init', 'yoast_disable_admin_bar' , 9);
0
就在這個獨自在functions.php中對我的作品。
// Remove Admin Bar Front End
add_filter('show_admin_bar', '__return_false');
0
對於wordpress 3.4.2,這些解決方法都不應該工作。我已經整理出一個非常簡單的技巧來隱藏管理欄!
調用wp_head()剛過,把這個樣式聲明:
<style>
html { margin-top: 0px !important; }
* html body { margin-top: 0px !important; }
</style>
它不涉及修改的功能或什麼的。只是普通的舊CSS! 我希望它解決了Google員工的問題,不久的將來:-)
0
在functions.php
將這個:
/* Disable WordPress Admin Bar for all users but admins. */
if(!current_user_can("manage_options")){
show_admin_bar(false);
}
0
您可以通過插件做到這一點,鏈接如下:
http://wordpress.org/plugins/global-admin-bar-hide-or-remove/
完美!我不知道每個用戶帳戶中的管理欄設置。謝謝! – cqde 2011-05-02 04:38:53
優秀!解決了我的問題! – 2012-10-29 16:51:01