• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

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
0
rogerk_fsww
Asked:
rogerk_fsww
  • 7
  • 5
1 Solution
 
Jason C. LevineNo oneCommented:
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.
0
 
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
0
 
Jason C. LevineNo oneCommented:
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>
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
0
 
Jason C. LevineNo oneCommented:
>> 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.
0
 
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.
0
 
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
0
 
Jason C. LevineNo oneCommented:
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
0
 
rogerk_fswwAuthor Commented:
Great job Jason. Thanks.
0
 
rogerk_fswwAuthor Commented:
Hey Jason,

Forgot to ask which plugin you used?

Roger K
0
 
rogerk_fswwAuthor Commented:
Awesome - Thanks.
Now back to work on the site.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now