
WordPress 修复插件
Recently, one of our users reported that they are missing the 管理栏 on their WordPress site, and asked for our help. The admin bar is a floating bar that appears on every page of your site when you are logged in. It contains some useful shortcuts to different sections of the WordPress admin area. In this article, we will show you how to fix the missing admin bar issue in WordPress.
最近,我们的一位用户报告说他们丢失了WordPress网站上的管理栏 ,并要求我们的帮助。 管理栏是一个浮动栏,当您登录时会显示在网站的每个页面上。它包含一些有用的快捷方式,它们可用于WordPress管理区域的不同部分。 在本文中,我们将向您展示如何解决WordPress中缺少的管理栏问题。

影片教学 (Video Tutorial)
如果您不喜欢该视频或需要更多说明,请继续阅读。
如果您不喜欢该视频或需要更多说明,请继续阅读。
为什么会出现缺少管理栏的问题? (Why Missing Admin Bar Issue Occur?)
Usually this happens when a plugin or an active theme is not allowing WordPress to properly execute the code in the footer area of your website. This code is triggered with the function <?php wp_footer(); ?>
.
通常,当插件或活动主题不允许WordPress正确执行网站页脚区域中的代码时,就会发生这种情况。 该代码由函数<?php wp_footer(); ?>
触发<?php wp_footer(); ?>
<?php wp_footer(); ?>
。
当主题缺少此代码,或者插件做了一些搞砸的事情时,您最终会遇到缺少 WordPress 管理栏的问题。
如果主题缺少此代码,或者插件执行一些令人困惑的操作,您最终将遇到缺少 WordPress 管理栏的问题。
修复缺少的管理栏 (Fixing the Missing Admin Bar)
The most common culprit causing this problem is a missing <?php wp_footer(); ?>
line in your theme. This function is usually found in a theme’s footer.php file just before the </body>
tag.
导致此问题的最常见原因是缺少<?php wp_footer(); ?>
<?php wp_footer(); ?>
在您的主题行。 通常在主题的footer.php文件中</body>
标记之前找到此功能。
Before you do anything to fix it, make sure you create complete WordPress 备份 or at least backup your theme files.
在进行任何修复之前,请确保您创建了完整的WordPress 备份或至少备份了主题文件。
Connect to your website using an FTP程序 like Filezilla, or use the File Manager in your 虚拟主机 account’s cPanel dashboard.
使用FTP 程序(如Filezilla)连接到您的网站,或使用虚拟主机帐户的cPanel仪表板中的文件管理器。
Next, go to your theme folder which is located inside /wp-content/theme/
folder and download a copy of your theme’s folder to your Desktop as backup.
接下来,转到/wp-content/theme/
文件夹中的主题文件夹,然后将主题文件夹的副本下载到桌面作为备份。
You would need to locate the footer.php file inside your theme folder and scroll down to the end of the file to see if you have <?php wp_footer(); ?>
line before the </body>
tag.
您需要在主题文件夹中找到footer.php文件,然后向下滚动到文件末尾以查看是否有<?php wp_footer(); ?>
</body>
标记之前的<?php wp_footer(); ?>
行。
如果您没有此行,则需要添加它,然后将更改后的文件上传回您的服务器。
如果没有这一行,则需要添加它,然后将更改后的文件上传回服务器。
If you are using a 儿童主题 and your child theme does not have a footer.php file, then you need to check the parent theme’s footer.php file to locate the wp_footer
function.
如果使用的是副主题,并且子主题没有footer.php文件,则需要检查父主题的footer.php文件以找到wp_footer
函数。
如果将 wp_footer() 函数添加到您的主题不能解决您缺少管理栏的问题,那么不用担心,您可以采取其他措施来解决此错误。
如果将 wp_footer() 函数添加到您的主题不能解决您缺少管理栏的问题,那么不用担心还有其他方法可以修复此错误。
故障排除 (Troubleshooting)
暂时切换回默认主题。有时您可能会在主题文件中看到 wp_footer 函数,但管理栏仍然可能无法工作。在这种情况下,您需要切换到默认主题,以确保当前主题不会导致此问题。
暂时切换回默认主题。有时您可能会在主题文件中看到 wp_footer 函数,但管理栏可能仍然无法工作。在这种情况下,您需要切换到默认主题以确保您当前的主题不会导致此问题。
编码不当的插件也可能导致此错误,因此要检查插件是否导致此问题,您需要停用 WordPress 网站上的所有插件。如果这解决了您的问题,则意味着有一个插件导致了此问题。
编码错误的插件也可能导致此错误,因此要检查是否是某个插件导致此问题,您需要停用 WordPress 网站上的所有插件。如果这解决了您的问题,则意味着有一个插件导致了此问题。
现在您需要找出哪个插件导致了这个问题。您可以通过一一重新激活插件来完成此操作,直到找到导致问题的插件。
现在,您需要找出哪个插件导致了这个问题。为此,您可以逐步重新激活插件,直到找到导致问题的插件。
Lastly, you can turn the debugging on by opening wp-config.php file and changing define('WP_DEBUG', false);
to define('WP_DEBUG', true);
. WordPress will now show you warnings and notices that were previously hidden. These warnings and notices can hint towards the file causing this issue.
最后,您可以打开wp-config.php文件并更改define('WP_DEBUG', false);
来打开调试define('WP_DEBUG', false);
define('WP_DEBUG', true);
。 WordPress现在将向您显示以前隐藏的警告和注意事项。 这些警告和注意事项可能会提示导致该问题的文件。
就这样,我们希望这篇文章能帮助您解决 WordPress 中缺少管理栏的问题。您可能还想查看我们的指南“每个人都应该了解 WordPress 管理栏”。
就这样,我们希望这篇文章能帮助您解决 WordPress 中缺少管理栏的问题。您可能还想查看我们的关于 WordPress 管理栏每个人都应该了解的指南。
If you liked this article, then please subscribe to our YouTube 频道 for WordPress video tutorials. You can also find us on 推特 and 谷歌+.
如果您喜欢这篇文章,请订阅我们的YouTube 频道 WordPress视频教程。 您也可以在推特和谷歌+上找到我们。
翻译自: https://www.wpbeginner.com/wp-themes/how-to-fix-missing-admin-bar-issue-in-wordpress/
WordPress 修复插件