Articles of admin bar

Adding the Admin Bar to a page with a custom template

I created a stripped-down page template to use for my landing pages. But I must have cut too much out of it, because I’ve lost the WordPress 3.1+ Admin Bar. What functions do I need to call to get the Admin Bar to appear at the top of the page again?

Problems with removing admin bar

I am trying to remove the admin bar from a theme front end of a theme. I found the following code block: add_filter( ‘show_admin_bar’, ‘__return_false’ ); remove_action( ‘personal_options’, ‘_admin_bar_preferences’ ); Which works fine. However I wanted to add a choice for the user, so that I can add a permanent code block to my boilerplate […]

Why is the admin bar appearing (on certain pages) for non logged-in users?

The admin bar is appearing for non logged-in users on one of my sites, but only for two specific pages (/work and /contact, for what it’s worth). Has anyone heard of this happening before? It appears as though one of the site’s users is logged in (their username is displayed), but clicking any links on […]

Is there a ready-made fix to make the admin bar not obscure content?

I have a situation where the WordPress 3 Admin Bar (which is cool and I do want to have) obscures some important information on my page. Before I start fiddling with the CSS myself (which I’m sure will break stuff): Is there an existing patch to change this so the Admin Bar starts “above” the […]

How to change the Admin-bar's link target?

I’d like to change the admin bar‘s link target to “_blank”. where what should I do? thanks.

wp_before_admin_bar_render action not working in back office

This is working great in the front site wp admin bar: add_action(‘wp_before_admin_bar_render’, ‘customize_admin_bar’); function customize_admin_bar() { global $wp_admin_bar; if (is_user_logged_in()) { if ( !is_admin()) { $wp_admin_bar->remove_menu(‘edit-profile’); //$wp_admin_bar->remove_menu(‘user-info’); $wp_admin_bar->remove_menu(‘comments’); $wp_admin_bar->remove_menu(‘new-media’); $wp_admin_bar->remove_menu(‘new-tvr_booking’); $wp_admin_bar->remove_menu(‘new-vp_orbitslides’); $wp_admin_bar->remove_menu(‘orbitslider_settings’); //$wp_admin_bar->remove_menu(‘site-name’); //$wp_admin_bar->remove_menu(‘dashboard’); /*$wp_admin_bar->add_menu( array( ‘id’ => ‘custom-account’, ‘parent’ => ‘my-account’, ‘title’ => __( ‘Mi cuenta’), ‘href’ => ‘/pedidos/products-page/your-account/’ ) );*/ } } } […]

Open Admin bar “Visit site” in a new window

Is it possible to create a filter to make in sort that the link in the admin bar to open in a new window. I know that the right-click -> open in a new tab is a common use for us programmers but for the client who use it, it could be great to open […]

Top admin bar / toolbar not showing even when logged in, but empty top margin showing?

I wrote a theme and the top admin / tool bar is not showing. I still see an empty margin. Any ideas? Here the top margin I never set anywhere in my files. I actually want to show the toolbar completely.

How can I check if the admin bar is visible to the current user?

I’m new to WordPress. I would like to know Is the admin bar visible to all users and roles? If not, how can I check it is visible to the current user?

How do I turn off the Admin Bar for all Subscribers?

Maybe this is a stupid question. When a user logins to my WordPress site with the Subscriber role, they have the WP Admin Bar appearing at the top of the page. The user can go into their dashboard and turn this off themselves. But how can I turn this off by default for all existing […]