I recently was working with a client who wanted to provide a site-wide link to a support page, where he provided answers to common questions and a contact form to submit a support request.
I proposed adding a fixed tab at the side of the page, which would scroll with the page, so that it’s always visible, no matter page you’re on, or what part of the page you’re looking at.
This of course should be reserved for a single function that is most important to your site. That could be a link to a Donations page, a Support page, a Contact page, or your Store.
Build the graphic
First, we’re going to build the graphic for the button that will be the actual link.
Since I already built one for my client, I figured I’d just offer you the .psd Photoshop file to get you started.
The button is set up to appear on the left-hand side of the screen (can be rotated 180 degrees for right hand side of screen), has 9 different colors to choose from (can set custom color if needed) and uses the word Support (can be changed to Store, Donate, Contact etc.).
Once you’ve downloaded the template and set it up for your needs, save it as a PNG and upload it to an appropriate place on your server, possibly your theme’s images folder.
Display it on your site
Now that you’ve created the button, you just need to display it on your site.
Start off by opening up your theme’s stylesheet. If you haven’t yet created a child theme, you should do that before editing an original theme.
Paste the following CSS code to the bottom of your stylesheet. Note that you need to edit the background URL to reflect where you uploaded your own image.
#side-tabs a.support {
background: url('http://www.yourdomain.com/wp-content/themes/yourtheme/images/support-tab.png');
left: 0px;
top: 250px;
height: 108px;
width: 45px;
margin: 0;
padding: 0;
position: fixed;
z-index: 9999;
display:block;
}
You can also change other variables to suit your needs:
- To move the tab to the right, change the word left, to right.
- To move the tab up or down the page, change the top value.
- To use a different size image, edit the width and height values.
Now that everything’s in place, you just need to call upon it, to actually display it. Copy the following code into footer.php, just above the closing body tag:
<div id="side-tabs"> <a class="support" href="http://www.yourdomain.com/support-request/"></a> </div>
You need to keep the CSS IDs and classes in line with your CSS, but you should change the href to wherever you want people to be redirected to after clicking on the tab.
Now, with any luck, you’ll have something that looks like this. Of course, you can make it look however you want by creating your own image in Photoshop, instead of using the template.
So, what application did you use this for?


June 8, 2012 at 2:44 pm
Thank you! If you could explain how to create a hover state with this, that would be a nice addition.
June 11, 2012 at 9:21 am
Hi Kayle,
Certainly. You can add the ruleset #side-tabs a:hover.support and make whatever changes you need, so if you want to change the background image, you could make it:
#side-tabs a:hover.support {
background: url(‘http://www.yourdomain.com/wp-content/themes/yourtheme/images/support-tab-hover.png’);
}
Hope that helps
June 18, 2012 at 8:22 am
Hey Dave
Thanks for the code for the fixed tab, Works a treat on my site, I’ve used it for the forum I have just built and I think it looks pretty good.
Cheers
Geoff.
June 18, 2012 at 10:03 am
Sweet, nice use of the tab and you even customised it. You’re welcome.
August 21, 2012 at 3:57 pm
Thanks for the help Dave! Used this on a site I designed and it worked beautifully. Great tutorial!
August 31, 2012 at 1:30 am
Dave,
Any tips on how I can show this tab only when a user is logged in? I would like to show it only when a subscriber is logged in.
Thx.
Sanjay
August 31, 2012 at 2:32 pm
Of course, you can just wrap the whole function in a is_user_logged_in conditional statement, such that when they’re logged in, the tab is shown and if they’re not, it’s omitted.
September 25, 2012 at 3:56 pm
Are there any examples of this on a live site?
October 5, 2012 at 8:22 am
Thanks for the great tutorial. Is there a way to make the tab refer to an image rather than a section of the website? I’d like to be able to open up a support info image while allowing the user to stay on the same page. Thanks in advance and have a great day!
October 5, 2012 at 8:56 am
Well, yes, you could, for example, make the hyperlink reference an image (href=”http://……jpg”) and force it to open in a new window (target=”_blank”), thus not closing or navigating away from the current window. Another way would be to have it pop-up in the middle of the screen in a lightbox effect, but that would require some jQuery and I’m not immediately sure how to do that, but a bit of research should quickly yield an answer.
March 28, 2013 at 7:11 pm
How do you get it to be on the right?
March 29, 2013 at 9:07 am
In the CSS, change left: 0px to right: 0px. That’ll do it ;)
May 16, 2013 at 4:37 am
Hi Dave, Is there a way to control the tab on browser resizing? Mine is moving on browser resize….
May 16, 2013 at 9:15 am
Hmmm, where is it moving to? In what browser? The CSS is quite strict and explicit and should keep the tab in a fixed position.