Okay
  Public Ticket #164040
Remove admin bar Wordpress
Closed

Comments

  • Jasper started the conversation

    Hello, I want to remove the Wordpress at top of my page for everyone. How can I do this? I found this code, it says it's for functions.php but you changed that file. So where can I put the code? Or is there another option to do this? 

    /* Disable the Admin Bar. */
    add_filter( 'show_admin_bar', '__return_false' );
    <?php function yoast_hide_admin_bar_settings() {
    ?>
      <style type="text/css">
        .show-admin-bar {
          display: none;
        }
      </style>
    <?php
    }
    function yoast_disable_admin_bar() {
        add_filter( 'show_admin_bar', '__return_false' );
        add_action( 'admin_print_scripts-profile.php',
             'yoast_hide_admin_bar_settings' );
    }
    add_action( 'init', 'yoast_disable_admin_bar' , 9 );
    

     

  •  327
    Brian replied

    Actually just put it at the end of the functions.php file - make sure it's before the closing php tag which looks like this: ?>

  • Jasper replied

    My website only shows a white page then. Maybe because I use plugins that show information in that bar?

  •  327
    Brian replied

    That would mean the code you're entering in is incorrect. Try it with the default WordPress theme active instead of Flavor and see if it works - that will isolate if the issue is with your code or just where you're putting it within Flavor

  • Jasper replied

    Hmm, I quess the code is wrong. Other theme also gives a white screen. So I will look for something else to hide the wordpressbar for everyone.

     

    Why do I see the wordpress bar on my website when I'm not logged in, and not on your demo site? Or your site completly clean?

     

    Edit: Found it, Buddypress setting to show also not logged in users the bar. Now I only have to found an option to hide the bar to logged in users.

     

    Added now and that works :

    show_admin_bar(false);

     

  • Jasper replied

    Something else just to put it somehere #sizzlin-wrapper is still visible when turned off on the mobile phone. You dont see the sizzlin part but the margin-top and bottom are still used in the css so you get a lot of empty space. I had to display: none that part.

  •  327
    Brian replied

    Glad you figured out the first issue. For the sizzlin bar, did you completely disable the entire bar or just the slider and/or social badges? Can I view your URL so I can look at the code? Thanks.

  • Jasper replied

    I checked all options to hide sizzlin stuff.

    • Disable the slider by default
    • Completely disable the slider
    • Disable the social icons
    • Hide the sizzlin' slider icon

     

    If you go to http://bigandsmallscreen.nl/ and go in mobile view and check out display:none on the wrapper in your browser, then you will see the empty space is there again.

  •  327
    Brian replied

    Looks to me like it's not the sizzlin slider but rather the bottom margin on the logo. Try adding this to your custom CSS theme option:

    #logo {margin-bottom:0px;}

     

  • Jasper replied

    Nope I don't want my subtitle against the menu. And I used #sizzlin-wrapper {display: none;} that helped. Thats why the empty space is gone on my mobile. On desktop it was always gone.

  •  327
    Brian replied

    So are you saying it's fixed now or that you still need help with it? Is the issue that you need to know how to use a media query to target just mobile? 

  • Jasper replied

    All is working now :) Thanks!