Steve Grunwell

Open-source contributor, speaker, and electronics tinkerer

Quick Tip: Override WordPress Toolbar Styles

I’m working on a project right now that uses the WordPress Toolbar, that dark-colored bar at the top of the administration area (and optionally your site) since version 3.3, as part of the site template. Unfortunately the default styles didn’t quite cut it for this project, so I needed to come up with a way to override these styles with my own.

Since the toolbar structure was fine (I really just needed to change some colors and tweak the content), the solution I came up with was this:

First, create a new stylesheet in your theme directory – in my case, I created css/admin-bar.css – then add the following to your functions.php file:

This will conditionally enqueue/register a new CSS file to be loaded if and only if the “admin-bar” CSS file (wp-includes/css/admin-bar.css) is loaded. Use this stylesheet to contain any overrides to the default styles.

Previous

Keeping WordPress Under [Version] Control with Git

Next

An Introduction to Sass in Responsive Design

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Be excellent to each other.