WordPress: Add a Top Message Bar

With the new site, I’d been looking for a top bar for WordPress for quite some time. Our last theme design actually had an entire section that could be pulled down that advertised our email subscription. This increased the number of subscribers so significantly that I incorporated the subscribe field directly into the header of the theme.

Now I just wanted a top bar to keep readers up to date on any key messages we wanted to remind them about… including news and events. I was going to write this directly into our theme but found WP-Topbar, a nicely written top bar plugin for WordPress. There were some others out there that has other features… like rotating messages or message scheduling, but the simplicity of this plugin won them over.

I appreciated that the top bar wasn’t hardcoded at the top of the page content; instead, it’s dynamically generated and appears with settings that include a delay and speed for displaying it… a really nice touch! You can control the colors (and even background image) of the bar, the message, add a link, and even apply your own CSS to it. The administration also has a preview so you can preview all of your changes before putting it live.

Note, there are some top bar plugins out on the market that are charging money… but I think this one is worth more!

UPDATE: I did make some updates to the plugin. It’s now loading from wp_footer rather than wp_head (that’s WordPress API talk) and I updated the div to have an ID and styling to fix the bar rather than having it relative. This way, the bar stays put while you scroll down the page.

Exit mobile version