• When I view my sites when I am logged in, the wordpress bar at the top of the page covers over the menu bar of my website. Is there a way to “hide” the bar while logged in? Right now I have to log out after making changes to view and use the sites menu bar and log back in to make changes. Very inconvenient…

    Any suggestions?

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    The wordpress admin bar (i.e. that grey bar) should automatically shift your theme down by 25px. What theme are you using?

    Thread Starter amginc2011

    (@amginc2011)

    Breckenridge Theme 1.0 by Kelli Bennett

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Check to make sure you have a call to wp_head() and wp_footer() in your templates. You need both of them.

    I don’t see the theme available on the WP repo, nor from any place I would deem reputable, so it may just be a sucky theme that wasn’t updated for 3.x land 🙁

    Um – not sure I’d go as far as calling the theme “sucky”. I have a similar issue on one of my own themes and it is in the Theme Repo. The hard truth is that the Admin bar can still cause some issues in sites that use absolute positioning and there’s no easy, global, fix for this.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Sucky was a poor choice of words, you’re right! Mea culpa!

    For absolute positioning, I have that problem on one site and there’s a quick fix for it. I put this in my function file:

    /* Adminbar adjustments */
    
    function link_to_stylesheet() {
            if ( is_user_logged_in() ) {
            ?>
            <style type="text/css">
            #logo {position:absolute;top:75px!important;}
            </style>
            <?php }
    }
    add_action('wp_head', 'link_to_stylesheet');

    In my case the #logo div was positioned absolutely, so I just tossed that in. Now if you’re logged in, it bumps the logo down. If not, it doesn’t. Works like a champ.

    I may have to use something similar in my theme. I was hoping to solve it using pure CSS but, so far, I’ve not been able to come up with anything.

    Update: the function you suggested will still amend your logo positioning if the user is logged in but has disabled the admin bar in their profile. Try:

    /* Adminbar adjustments */
    function link_to_stylesheet() {
    	if ( !is_user_logged_in() )  return;
    	global $current_user;
    	get_currentuserinfo();
    	if( _get_admin_bar_pref( 'front', $current_user->ID) ) :?>
    <style type="text/css">
    #logo {position:absolute;top:75px!important;}
    </style>
    	<?php endif;
    }
    add_action('wp_head', 'link_to_stylesheet');

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    No one can disable the admin bar on my site, so it’s not a worry for me, but that’s a solid call!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WordPress Bar’ is closed to new replies.