Wordpress Admin Bar Not Showing on frontend of sit

2019-03-10 16:26发布

Please could anyone help me with this problem? The wordpress admin bar is not displaying on the front-end (public visible pages) of my website. It shows when I'm logged in at the backend i.e Dashboard though. User settings are ok (set to show admin bar when viewing the site). I have tried deactivating (then, re-activating ) installed plugins, still no show.

Just a background note: I recently transferred the site to my webhost (I was developing locally and everything worked and is still working). And I have a custom folder for wordpress. I was wondering if the problem has to do with this.

Please help I have searched everywhere but seems everyone is looking to hide the admin panel instead.

Thanks in advance

16条回答
Summer. ? 凉城
2楼-- · 2019-03-10 16:52

Check that your theme includes a call to the function wp_footer() at some point, usually at the very bottom of footer.php. That generates the code required for the admin bar to show.

查看更多
The star\"
3楼-- · 2019-03-10 16:53

First, double checked all of the other items mentioned here (wp_footer(), etc).

Three more things to check:

  • make sure header.php has <body <?php body_class(); ?>> not just <body>
  • try disabling plugins one by one if you're still having trouble. (For me, the Simplest Gallery 2.7 with WP 3.7.1 caused a conflict that made the admin bar disappear)
  • look for function remove_admin_bar() { return false; } in the theme's functions.php - change it to return true.
查看更多
倾城 Initia
4楼-- · 2019-03-10 16:54

add this to the end of your footer.php in your theme folder:

<?php wp_footer(); ?>

problem solved :-)

查看更多
三岁会撩人
5楼-- · 2019-03-10 16:54

For me the issue was that I was using http://mydomain.com/wp in the WordPress address but http://www.mydomain.com for the site address. We had added the www to the WordPress address so that GoogleAnalytics would work and that's when the Admin Bar broke.

Adding www to the WordPress address fixed the issue.

查看更多
登录 后发表回答