New Admin Bar Not Functioning
Check footer.php and make sure it contains <?php wp_footer(); ?>.
Check footer.php and make sure it contains <?php wp_footer(); ?>.
Try the following code: <html> <head> <script type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/19979/wp-includes/js/admin-bar.js”></script> <link rel=”stylesheet” type=”text/css” href=”wp-includes/css/admin-bar.css”> </head> <body> <?php require_once( dirname(__FILE__) . ‘/wp-load.php’ ); wp_admin_bar_render(); ?> </body> </html>
Checking the capability of the users you can determine whether to show or not the admin bar. add_action( ‘after_setup_theme’, ‘remove_admin_bar’ ); function remove_admin_bar() { if( ! current_user_can( ‘administrator’ ) || ! current_user_can( ‘editor’ ) || ! current_user_can( ‘author’ ) ) { show_admin_bar(false); } }
What you’re looking for is to set a variable that determines whether a user is logged in (and other circumstances where you don’t want caching), then pass that variable to fastcgi_cache_bypass and fastcgi_no_cache: So in your server{} block you want something like this: set $skip_cache 0; # POST requests and urls with a query string … Read more
Since I think that mis-identifying all users not-logged in is extremely unlikely, my line of thought is that wrong non-public version of page was cached for some reason.
It looks like your theme is missing the wp_footer() function, but is containing the wp_header() function. I can replicate this behavior on the default themes, by removing wp_footer(). The HTML for the admin bar comes from this part in the Core code: add_action( ‘wp_footer’, ‘wp_admin_bar_render’, 1000 ); It’s usually informative to check out the default … Read more
In the WP_Admin_Bar::add_menus() class method you will find the actions: add_action( ‘admin_bar_menu’, ‘wp_admin_bar_my_account_menu’, 0 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_my_account_item’, 7 ); and the two corresponding callbacks are using get_avatar(). To prevent the avatar changes in the admin bar, we can remove the foo_change_avatar filter before these callbacks and then add it again after the admin bar … Read more
This one does the job for us, we use WP3.7.1. function no_wp_logo_admin_bar_remove() { global $wp_admin_bar; $wp_admin_bar->remove_menu(‘wp-logo’); } add_action(‘wp_before_admin_bar_render’, ‘no_wp_logo_admin_bar_remove’, 0);
You should use conditional tag inside function hooked to show_admin_bar filter. add_filter( ‘show_admin_bar’, ‘show_adminbar_on_homepage_only’, 20 ); function show_adminbar_on_homepage_only() { return is_user_logged_in() && is_front_page(); }
I Think there is no hooks that I can find to remove those areas without touching the core files.. You can remove parts of the admin areas using this functions and with some css help. To hide Menus // remove unnecessary menus function remove_admin_menus () { global $menu; // all users $restrict = explode(‘,’, ‘Links,Comments’); … Read more