The WordPress admin bar will either show or not show. It should not be visible on some pages, then disappear on others.
When you have the WP admin bar not showing on certain pages, the problem is almost definitely your theme files.
Before editing theme files, be certain it is a glitch on SOME pages first.
If the WordPress toolbar is not showing on ANY pages, that is a site-wide problem with multiple possible culprits.
When it is restricted to a limited number of pages, that points towards one or more of your theme template files missing a line of code.
When the WordPress admin bar is not showing, the problem is one or more of the theme template files are missing the <?php wp_footer(); ?> hook. The admin bar is controlled by the footer.php file. If the footer fails to load, the WP admin bar will not show.
Find and fix your WP template files
It is standard on all WordPress theme templates to use the wp_footer() hook. It is part of the WordPress core framework. This controls your admin bar. Unless you are using a really old WP theme, that will be included.
What is more likely to happen is one of your page or post templates may be missing the hook to call up the footer file.
Log into your WordPress website as a site administrator.
Go to “Appearance” > “Theme Editor.”
On the right, you can select any WordPress theme you have installed. Check that you are viewing the theme that you have currently active.
Under the theme selection drop-down menu, there is a list of every file for your theme.
When your WordPress admin toolbar is not showing on certain pages, it is more likely one of these template files is missing the wp_footer() code.
How do you know which theme file to edit?
Use your browser inspector tool. All modern browsers have an “Inspect” tool.
In Chrome and Safari, right-click and select inspect. If you use a Mac and Safari, the developer menu needs to be enabled first. Select preferences > Advanced > Show Develop menu in the menu bar.
Right-click at the top of the page that is missing the WP admin toolbar. The “body class” element is your theme file template.
The example above highlights the template name as “page template, no sidebar.”
Match the body class template shown in the browser inspector to the theme file in your WP theme editor…
The last snippet of code is
<?php get_footer();
That is because the theme footer is the template file with the wp_footer() hook.
<?php wp_footer(); ?>
When you have some pages or posts not showing the WordPress admin bar, it will be because one of those two hooks is missing in the template file.
Without calling up the footer.php file, the WP admin bar will not show.
Add the code before the </body> tag to call up the footer, and then your admin bar will load.
Scrub your cache, delete browser cookies, reload the page
Caching plugins are a gem for saving on bandwidth, but they are ridiculous for troubleshooting. The problem is that you are left constantly viewing a static version of a saved page.
To render new, updated content, the static version needs to be scrubbed. Most cache plugins have a one-click option to “purge” the cache.
Do that, and also clear your browser cookies.
You can do that in one of two ways. The fastest is to open your browser history and clear all.
In Chrome, the URL is chrome://history. Select “Clear browsing data.” If you would rather not scrub all your history, the alternative is to delete only the cookies for your site.
In Chrome, you can do that by clicking the three stacked dots in the top right, selecting “Settings,” then choosing the “privacy and security” option on the left.
From there, click “Cookies and other site data,” then on the next page, select “See all cookies and site data.”
The next page is a list of every cookie stored in your browser. The top right has a search bar. Where it says “Search cookies,” type in your URL, then delete those cookies.
Once you have deleted locally stored cookies and cleared your website cache, reload the page.
The WP admin bar should be showing on the pages or posts that it was failing to load on previously once the new code is rendered in your browser.
WP admin bar is not showing on some pages due to plugin problems
Plugin developers can code their plugins to add any link to the WP admin bar. It can be handy when it is done correctly.
The W3 Total Cache plugin has made good use of it.
You can purge your cache from edit mode on any page. Provided you can get the WP admin bar to show. The above correction should correct that.
Editing the admin bar with the wrong code, though, can cause WordPress to behave strangely.
The correct hook to use is
($wp_admin_bar)
If that function is used in either your functions.php file or you install a plugin that attempts to edit your wp_admin bar with incorrect code, that is when you get problems.
To give an example of what to look for in your theme or plugin files, the code below is for adding a custom link to the WP admin bar – without breaking it.
// add a link to the WP Toolbar function custom_toolbar_link($wp_admin_bar) { $args = array( 'id' => 'Hemmingway', 'title' => 'Check Readability with the Hemmingway App', 'href' => 'https://hemingwayapp.com/', 'meta' => array( 'class' => 'Quality-Check', 'title' => 'Readability Test' ) ); $wp_admin_bar->add_node($args); } add_action('admin_bar_menu', 'custom_toolbar_link', 999);
For WordPress site editors and content creators, the Hemmingway app is quite handy. A site administrator can include the code above in the functions.php file and it’ll place a link in the WP admin toolbar, making the external site easy to access for all users.
Getting the code wrong makes things break!
Things can get messy if a plugin developer attempts to add things to the admin toolbar with the wrong coding, or just an accidental typo.
The most likely cause for the WordPress admin toolbar not showing (on some pages) is your theme files. Start troubleshooting there. Make sure any custom page or post templates have…
<?php get_footer();
And that it is placed before the end body </body> tag.
Failing that, begin troubleshooting plugin compatibility issues by disabling all plugins, then re-enabling them one by one, refreshing your site in a new tab after each plugin is enabled.
When plugins break your admin bar, you can view the source code using the plugin editor. Search the files for the code ($wp_admin_bar). A plugin using that hook wrong will break the admin toolbar.
Hey guys! It’s me, Marcel, aka Maschi. On MaschiTuts, it’s all about tutorials! No matter the topic of the article, the goal always remains the same: Providing you guys with the most in-depth and helpful tutorials!