Solutions to the disappearance of admin bar at the top of WordPress 3.1


(as shown in the figure below), the official name is admin bar. In Chinese, we call it administration toolbar, also known as administration toolbar and shortcut link bar, which refers to the admin bar.

WordPress 3.1顶部admin bar不见了? - DarkBlue - DarkBlue Log

Some time ago, after modifying the index.php file of the topic, I found that the admin bar was missing. Specifically, where the admin bar was supposed to be displayed, it was a blank space (the background color preset in the background attribute of the body label, to be exact). In other words, the original place occupied by admin bar is still there, but the admin bar is missing. After a search, we found that there are two situations that can cause such problems.
First, check the footer.php file of the topic and locate it to the end (Ctrl + end). The end of this file should be the following structure:

<?php wp_footer(); ?>

That is to say, there must be a wp_footer() function at the end of the footer.php file, and it must be placed strictly before the end tag of the body tag.
Another reason is similar to this, except that in the header.php file, there must be the wp_head() function, which must also be placed strictly before the < / head > label.
If any of the above reasons are not satisfied, it will cause the problem of admin bar missing.
However, after the inspection, it was found that in my personal situation, although the above conditions were met, the admin bar was still missing. It turns out that in the index.php file of the topic, the sentence <? PHP get_footer();? > was deleted by mistake. Although the truth is the same, it is still a noticeable problem.
However, there are many problems that lead to the disappearance of the admin bar. If you find that the admin bar is missing, don’t rush to look at the code. First, change back to the default theme to see if the problem still exists. Check the background settings (you can set hide or display the admin bar in the user settings of the background control panel), see if the implementation file of the admin bar is in or damaged, etc.