So you bought Hello Bar Solo and you’re ready to install it on your WordPress site. Well you’ve come to the right place. And we have some good news too, Hello Bar Solo requires only a few steps in order to get it set up and running on WordPress.org-powered sites. (Note: This installation guide is for WordPress.org sites only. Hello Bar Solo cannot be installed on WordPress.com sites.)
Before we get started, let’s familiarize ourselves with the files Hello Bar Solo comes with. Nested in the zip file, you’ll find a directory titled hellobar-solo. This directory houses all the files we’ll need to install Hello Bar Solo on WordPress.
Inside that directory you’ll find the following files:
hellobar.js
This is the library that houses all of the code that allows Hello Bar Solo to work properly. We’ll be telling WordPress to enqueue this file.
hellobar.css
This is the style sheet that makes your Hello Bar Solo install look pretty.
sprite-8bit.png
This is an image sprite that houses all of the visual elements referenced in the CSS file.
textures.png
This is another image sprite that contains all of the textures available for use with Hello Bar Solo.
Step One:
We’ll need to move the files listed above into the right folder in the WordPress installation directory in order to get things working. To do this, place the “hellobar-solo” directory we referenced above into your WordPress website’s theme folder. (for example /wp-content/themes/twentyeleven/). This will get things nice and comfy within our theme.
Step Two:
Now we need to reference our files within WordPress. While we can place <script> tags and <link> tags directly into the header.php file, it’s a WordPress best practice to register and enqueue scripts to be output appropriately. If you aren’t familiar with this technique, we recommend you check out the WordPress codex documentation on wp_register_script(), wp_register_style(), wp_enqueue_script() and wp_enqueue_style() for more information. This method will output the scripts on a page when they are needed, and also allow other scripts to detect what is being loaded so that files are loaded in the correct order and only output once.
To help you out with this, we’ve provided a simple code snippet that takes care of this for you. Just copy the code snippet below and paste it into the bottom of your functions.php file.
function hellobar_scripts() {
wp_register_script( 'hellobar_solo_js', bloginfo('stylesheet_directory') . 'hellobar-solo/hellobar.js');
wp_enqueue_script( 'hellobar_solo_js' );
}
add_action('wp_enqueue_scripts', 'hellobar_scripts');
function hellobar_styles() {
wp_register_style('hellobar_css', bloginfo('stylesheet_directory') . 'hellobar-solo/hellobar.css');
wp_enqueue_style( 'hellobar_css');
}
add_action('wp_enqueue_scripts', 'hellobar_styles');
We’ll now be able to access the functions in the hellobar.js file on every page, and the style sheet will be loaded on each page so that the Hello Bar looks awesome.
Step Three:
Now we’ll need to output a Hello Bar. We recommend doing this at the end of your footer file, which would give us a Hello Bar on every page. However, if you want to limit your Hello Bar to only specific pages you can also place the code within a template file. The following code snippet will give us the basic bar, but please check out http://www.hellobar.com/solo for a few demos and an overview of all of the customizations available.
<script type="text/javascript">// <![CDATA[
new HelloBar( '<span>Read my pitch and then click on my</span> <a href="#" class="button">Call to Action!</a>', {
showWait: 1000,
positioning: 'sticky',
fonts: 'Arial, Helvetica, sans-serif',
forgetful: true
}, 1.0 );
// ]]></script>
Step Four:
If you’ve placed your code snippet in the right place, The Hello Bar should now be outputting correctly. Congrats! You have you shiny new Hello Bar Solo up and running. Now plug in your key message, email subscription form, social widgets, or whatever content you want to highlight. Hello Bar will do the rest. Next? Kick back and watch your users take action!
Related posts:

Comments 19
I just downloaded Solo. I will be adding it to all of our sites. Is it possible to put ad server invocation codes in their to serve ads?
Am I doing something wrong? When I post the supplied code into the function.php file as well as output the Hello Bar in the footer.php file, I get absolutely nothing. Any insight as to why?
Yeah, I’m having the same issue as Jason. I’m not getting the hello bar. I’ve tried putting the snippet in step 3 in footer.php. Also tried putting it in the wordpress hellobar plugin. After completing only step 2, adding the code to functions.php, I’m seeing my theme directory printed out twice at the top, where the hellobar might go. You don’t mention this. Should I be seeing this? But it doesn’t change after doing step 3, and it doesn’t move when I toggle the plugin option between the header and footer. Spent several hours trying various things, and cannot figure out what’s wrong.
i gave up trying. winniewms2, please let me know if you figure it out.
I’m having the same problem.
This code outputs a text url path to my stylsheet. Using get_bloginfo instead of bloginfo displays nothing.
// wp_register_style(‘hellobar_css’, bloginfo(‘stylesheet_directory’) . ‘hellobar-solo/hellobar.css’);
Any help on this would be appreciated.
A quick fix is to use that path and put it into the script code. For example, if you are seeing something like this:
http://mydomain.com/wp-content/themes/mythemehttp://mydomain.com/wp-content/themes/mytheme
… then take the path (once) and put it into the code so the register function (i.e. wp_register_script) looks like:
wp_register_script( ‘hellobar_solo_js’, ‘http://mydomain.com/wp-content/themes/mytheme/hellobar-solo/hellobar.js’);
Do the same for the wp_register_style line.
The code that was provided *should* work but for some reason it’s not concatenating the filename on the end of the stylesheet which is why it is just echoing the path.
Actually.. there was an error in the script. It’s missing the wp_enqueue_script call in the first function. Here’s what I ended up that works fine. Just replacethe path to your theme…
function hellobar_scripts() {
wp_register_script( ‘hellobar_solo_js’, ‘http://yourdomain.com/wp-content/themes/mytheme/hellobar-solo/hellobar.js’);
wp_enqueue_script( ‘hellobar_solo_js’ );
}
add_action(‘wp_enqueue_scripts’, ‘hellobar_scripts’);
function hellobar_styles() {
wp_register_style(‘hellobar_css’, ‘http://yourdomain.com/wp-content/themes/mytheme/hellobar-solo/hellobar.css’);
wp_enqueue_style( ‘hellobar_css’);
}
add_action(‘wp_enqueue_scripts’, ‘hellobar_styles’);
Thanks for finding that issue! (post updated)
Thank you so much Jamie for following up with me on twitter/email & support (Brian?) for getting this fixed. Great people.
I can’t get this to work at all, I’ve now tried the basic set up through the header.php and also this method through functions.php.
Any ideas what I could be doing wrong?
Thanks,
Cain
the script WILL NOT work in my ‘Elegant theme’ Chameleon… doing this for 4 hours now… frazzled!!!
Any ideas?…
I put the following code which points to the directory path for the folder
function hellobar_scripts() {
wp_register_script( ‘hellobar_solo_js’, ‘http://metrohappiness.com/wordpress/wp-content/themes/Chameleon/hellobar-solo/hellobar.js‘);
wp_enqueue_script( ‘hellobar_solo_js’ );
}
add_action(‘wp_enqueue_scripts’, ‘hellobar_scripts’);
function hellobar_styles() {
wp_register_style(‘hellobar_css’, ‘http://metrohappiness.com/wordpress/wp-content/themes/Chameleon/hellobar-solo/hellobar.css‘);
wp_enqueue_style( ‘hellobar_css’);
}
add_action(‘wp_enqueue_scripts’, ‘hellobar_styles’);
All I get is the script text as above returned in the body of my page when I test it and then an error saying that the theme had already been loaded on line 103…
I also installed the hello bar widget for placing script and this seem to point elsewhere in plugins folder???????????????????????????????????
Should I just go through the pain of doing it manually? Adrian
Hello — I also tried this with Whitelight Themes from Woothemes and it doesn’t work. Tried adding the correct scripts to functions.php and it gave me a white page as soon as I added the script.
Please help?
I had the same white page but with error messages…
Trying to get it run on genesis news theme.
Carried out all the steps correctly without any errors.
Still hello bar not visible on the site.
Kindly help.
Hello Bar works well with the Thesis Theme as well…
Here’s a tutorial for installing Hello Bar Solo on Thesis: http://makewebworld.com/2012/03/websitecreation/install-hellobar-solo-thesis-theme/
Has anyone managed to get this working on headway theme? Shows nothing on my blog.
when trying to install this on sites running genesis – do you install it to the genesis folder or the child theme folder? i.e. If I’m running prose on Genesis, do I install to genesis or prose?
I have an elegant theme and my hello bar works perfectly! Simply add your code to the bottom of your header.php and BAM!
Leave a Comment