Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can I to add a wrapper class to the WordPress admin bar?

I would like to center the contents to the same width as my theme.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

There isn't a filter/wrapper for the admin bar CSS that you can plug into , the function is simply

  function wp_admin_bar_header() { ?>
  <style type="text/css" media="print">#wpadminbar { display:none; }</style>

You can over ride the CSS using !important or use jQuery to prepend a class/id to the bar.

Something like:

jQuery("<div id='custom-width'></div>").prependTo("#wpadminbar");
share|improve this answer
    
Thanks @Wyck for the clarification. –  mattrepublic Oct 14 '11 at 12:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.