WordPress admin bar not showing on frontend

I’ve tried everything I have found but nothing helps me.

I’ve put

Read More
<?php wp_head(); ?>

in header.php

and

<?php wp_footer(); ?>

I even tried:

  1. Disable all plugins
  2. Default WP theme
  3. and etc.

Related posts

Leave a Reply

11 comments

  1. Some custom wordpress theme doesn’t show the admin bar into the theme page same with the wp_head() and the wp_footer() wrote on the templates files.
    To resolve that problem just add the following code into your function.php or into your own plugin:

    function admin_bar(){
    
      if(is_user_logged_in()){
        add_filter( 'show_admin_bar', '__return_true' , 1000 );
      }
    }
    add_action('init', 'admin_bar' );
    

    Hope that help…

  2. If you had the bar showing previously, you might try this super-easy fix (worked for me):

    1. Go to your profile in WP Admin
    2. Check to see if “Show Toolbar when viewing site” is checked
    3. If not, select this and save … that should fix it
    4. If the option IS checked, deselect it and save. Then, select it again and save.

    Now have another look at the frontend. I did this and it fixed whatever the issue was without messing with any of the files.

  3. I have managed to make it appear again by adding

    <?php wp_footer(); ?>
    

    in “header.php” after </header> tag.

    One important thing is to clear cache (check if you have cache plugin for WordPress installed like WP Super Cache or LiteSpeed Cache..) and then CTRL + F5 to refresh page.

  4. Try disable your plug-in cache or disable for logged-in users. I had similar problem using WP Fastest Cache. Just disabled chache for logged-in users and it’s working.

  5. Solution is to put
    show_admin_bar(true); on top of your functions.php file.

    EDIT fix:
    Put like this to show only when user is logged in:

    if (is_user_logged_in()) {
        show_admin_bar(true);
    }
    
  6. I had this problem on our production site, but it was not occurring on local or staging sites. Turns out that the WordPress Address was incorrectly set with www whereas the site was always accessed without the www.

    The fix:

    • Go to settings > General
    • Ensure that WordPress Address and Site Address both match your site URL exactly

    Posting in case anyone else has same problem.

  7. Shortly: Most probably you have not logged in!
    Long answer:
    This problem happens to the new WordPress learners who try to create a custom theme. They put the wp_footer() and wp_head() functions and refresh and still do not see the admin bar. And it is because they have forgot to log in to /wp-admin/

  8. I am using WP Super Cache, and what worked for me was disabling this option in
    WP Super Cache Settings / Advanced / Cache Restrictions:

    Make known users anonymous so they’re served supercached static files.

  9. Just go to the wp-config.php file in your root directory, set

    define('WP_DEBUG', false);
    

    to

    define('WP_DEBUG', true);
    

    and go to the webpage where admin bar is not loading. There has to be some error in you php code.

    The problem is that admin bar loads in wp_footer hook or something, and if you have an error in you php code the page just stops loading and that’s why admin bar is not showing AND THAT’S WHY ADDING WP_FOOTER() TO “header.php” WORKS FINE.

    Better check errors, because you probably will get another funny things on your website later.

    Good luck!