admin bar shows even when it shouldn't

hey everyone,

I'm working on a theme for a "non-blogging" Wordpress web site.
In it I have a frontpage.php that is set as static. The problem i have is when I open it in Firefox I still see a margin at the top of frontpage where the admin bar would be. In Chrome it does not show.
In the head section of the header.php there is a <?php wp_head(); ?> tag that if I hide, then the margin is gone. Can i leave this tag out of the header file or is there a way to leave it in and make sure it's always hidden when not logged in?

Thanks,
Roger K
rogerk_fswwAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason C. LevineDon't talk to me.Commented:
How are you hiding the admin bar?  From the user preferences or via a plugin?

wp_head() is a non-critical function, so if you remove it and everything else still works, that's probably ok.
rogerk_fswwAuthor Commented:
Hi Jason,

I am new to WP so I'm not sure how it's hidden.
I created a new template page for the home page called frontpage.php using a modified index.php to take out the posts loop. One thing I noticed is that in firebug the head contains this snippet at the end of the head section:
------------------
<style media="print" type="text/css">
#wpadminbar { display:none; }
</style>
<style media="screen" type="text/css">
html { margin-top: 28px !important; }
* html body { margin-top: 28px !important; }
</style>
</head>
-----------------
It appears that this is the margin that I am seeing even though I am just viewing the site from a browser window from /localhost/wordpress/ Not the /localhost/wordpress/wp-admin/ that I think is where it should be appearing. I'm not really clear on how the login part for the blog works. The puzzling thing is that I see it in Firefox but not in Chrome. I guess the easiest thing is just to take out the <?php wp_head(); ?> tag. I just didn't know if that would mess anything else up. I still want to use a page for blogging somewhere after the frontpage.

Thanks again, Roger K
Jason C. LevineDon't talk to me.Commented:
You could also just kill the CSS:

<style media="screen" type="text/css">
html { margin-top: 28px !important; }
* html body { margin-top: 28px !important; }
</style>
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

rogerk_fswwAuthor Commented:
I wondered if that would be a problem later with other pages or logging into the admin interface?
I will try that and see what happens when I use the admiin page.
When I have tested it I will get back with results.

Do you think this is a "normal" behavior or did I mess something up with the whole WP theme?
That's what worries me about removing any of the stock code.

later, Roger
Jason C. LevineDon't talk to me.Commented:
>> Do you think this is a "normal" behavior or did I mess something up with the whole WP theme?

Without seeing the whole thing from the backend, hard to say.  It's certainly not typical theme behavior but whether it is something you did or if the theme is just not constructed properly to handle the admin bar (a relatively new thing) I couldn't tell you.

Personally, I hate the darn thing and disable it via plugin as one of my first actions on a new WP install.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rogerk_fswwAuthor Commented:
Jason,

One other thought I had was using a conditional php statement to disable it on the front page.
If I did that could I still get into the admin pages? Or would i have to add an Admin login page elsewhere?
My nubie mind has not completely wrapped around the intricacies of WP.

Thanks always.
rogerk_fswwAuthor Commented:
Jason,

I got your last response while I was writing my next question.
I think I would like to get rid of the bar too, Just too new to know if i have to have it for other stuff.

Roger K
Jason C. LevineDon't talk to me.Commented:
No one needs the Admin Bar.  I wouldn't be surprised to see it die off over time, or at least be set to non-visible by default
rogerk_fswwAuthor Commented:
Great job Jason. Thanks.
rogerk_fswwAuthor Commented:
Hey Jason,

Forgot to ask which plugin you used?

Roger K
Jason C. LevineDon't talk to me.Commented:
rogerk_fswwAuthor Commented:
Awesome - Thanks.
Now back to work on the site.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.