How to Add Tabber to Your WordPress Theme
Posted by admin_mwc on 31 October 2008 12:00 AM in Wordpress Help | 17 Comments
This post is quite similar to my previous post on how to add MooTabs to WordPress. I recently tested Tabber on my internet marketing blog and I find that it is better than MooTabs because it is compact in file size, easier to install and customize.
The default Tabber look and feel is acceptable. I did not need to make a lot of changes to make it look good on my web site. Compared to MooTabs, Tabber requires a lot less work to customize.
Step 1: Download Tabber
Go to Tabber’s web site and download the latest version of Tabber.
Step 2: Upload Tabber to Your WordPress Theme’s Folder
I like to store my Javascript files in a folder called “js”. For my CSS files, I like to store them in a folder called “css”. Let’s assume my template folder is called “cooltemplate”, you should upload the Tabber files in the following manner:
1. /wp-content/themes/cooltemplate/css – Upload example.css here. Alternatively, copy and paste all the contents of example.css into your theme’s style.css.
2. /wp-content/themes/cooltemplate/js – Upload tabber.js here.
Step 3: Add Tabber References to Your WordPress Theme’s header.php
Add the following code to your theme’s header.php file in between the head tags.
<script type="text/javascript" src="%3C?php%20echo%20bloginfo%28%27template_directory%27%29;%20?%3E/js/tabber.js"></script>
<script type="text/javascript">document.write('<style type="text/css">.tabber { display: none; }<\/style>');</script>
If you only display Tabber on the blog pages, do this to prevent the loading of the Tabber files on non-blog pages.
<script type="text/javascript" src="%3C?php%20echo%20bloginfo%28%27template_directory%27%29;%20?%3E/js/tabber.js"></script>
<script type="text/javascript">document.write('<style type="text/css">.tabber { display: none; }<\/style>');</script>
Step 4: Add Tabber Code into Your WordPress Theme’s sidebar.php
<div class="tabber">
<div class="tabbertab">
<h2>Tab 1</h2>
<p>Tab 1 content.</p>
</div>
<div class="tabbertab">
<h2>Tab 2</h2>
<p>Tab 2 content.</p>
</div>
<div class="tabbertab">
<h2>Tab 3</h2>
<p>Tab 3 content.</p>
</div>
</div>
This is the default code of the Tabber. The text between the h2 tags will be displayed as the titles of each tab. You don’t have to display the content of each tab in the between the p tags. I did it with the HTML list tags.
<div class="tabber"> <div class="tabbertab"> <h2>Recent</h2> </div> <div class="tabbertab"> <h2>Popular</h2> </div> <div class="tabbertab"> <h2>Most Commented</h2> <ul></ul> </div> </div>
The Tabber is a great place to insert all the comments and post lists. I personally use it to display the recent posts, popular posts, most commented posts, recent comments and top commenters.

Subscribe today to receive my eBook "How to Make WordPress Search Engine Friendly" FREE!



15 Comments On “How to Add Tabber to Your WordPress Theme”
On 8th January 2009 6:39 PM, Jared said:
Hi,
Thank you for your tutorial. I am also integrating tabber on my wordpress site. I was wondering if you knew of a way to place posts and the comment template in two separate tabs on a single.php page. So it would look like the wall street journal site where they separate their tabs and articles by using tabs. I can get it to work only the comments don’t submit correctly. It it seems to have to do with the display:none in the css but I am not sure. Hope this is clear.
For an example of what I am going for see http://www.wsj.com
Thanks again.
Jared
On 10th January 2009 3:33 AM, Jared said:
Hi,
I took a look at the site you sent. It looks really good and like the design but I can’t seem to see where the tabs have been implemented. Could you direct me with a more specific link? Sorry if I missed it.
Jared
On 12th January 2009 1:30 AM, Jared said:
Hi,
I think there might have been a mis communication. I see that in your side bar you have implemented tabs. I have been able to do something similar. What I mean is having a single post in one tab and all the comments for that post in another tab. There must be a way to do this but I can’t seem to get it to work. Do you think that taking the comments.php page and copying it into the single.php will allow the comments to submit correctly. Thanks for your help.
Jared
On 13th January 2009 12:28 PM, Vincent said:
Yes, you need to move the comments code into a tabber tab. Usually, the comments template is in the file comments.php.
If you want it displayed in the single.php file, you have a few solutions:
1. Create another template file, maybe call it comments-tabber.php and create the tabber code in this file.
2. Include the comments-tabber.php into your single.php where the current comments.php is.
On 13th January 2009 3:48 PM, Jared said:
Thanks so much for your help. I will give it a try. Great websites and tutorials.
Jared
On 1st September 2009 1:16 PM, Brian said:
ah great, looks like my comments disappeared after “logging in” with google connect.
I found Tabber by using the “Statement” wordpress theme, but am now using a new one. I’ve adapted Tabber to this new theme, but haven’t been able to figure out how to resize the Tabber “window”.
Any ideas?
On 16th November 2009 3:19 PM, syafwan said:
Thanks, that is great.
On 13th February 2010 1:08 AM, neford said:
Thanks for the post and tutorial I had no ideal about Tabber I will check it out
On 15th May 2010 5:29 PM, Steve Bruner said:
Tabber is now available as a WordPress plugin: http://wordpress.org/extend/plugins/tabber-tabs-widget/
On 21st August 2010 7:26 PM, thomas said:
yes! it works, after all. so disregard my previous comments. downside is: it kills all javascript included in the tabs
On 2nd September 2010 7:44 PM, Flick said:
Thank you for this tutorial!
I am working on a website that already uses mooTabs so am trying another tab system that can work concurrently with mooTabs and this solution has resolved all my problems!
On 10th September 2010 6:04 AM, John said:
I’m having trouble with the way the tabs display. They work fine on the main page (www.jrothraministries.com) but on all sub-pages and posts, they fail to display as tabs. I’ve poured over the code for missing information (div’s not closed or closed w/o opening them, etc.) but found nothing missing. I can’t figure out what’s going on. You can see the CSS for the Tabber tabs and tabber.js via the “View Source” then follow the URL (easier than posting here). I’m at a loss on this one.
This might help: I looked at the header and sidebar and every page calls them the same way, so if it’s in the HTML, it should be in the header or sidebar portions since that’s identical throughout. Any thoughts?
On 10th September 2010 10:57 AM, Vincent said:
Try disabling other javascript scripts one by one to see if it helps.
On 20th April 2011 2:15 PM, Geekyard said:
My blog looks cool with this widget
On 27th January 2012 7:35 AM, trouble said:
Hi,
first of all i am not really PHP expert.
I am working on a blog website.
On home page they are looking for recent post to show up.
on archive page it should be all the collection.
I was wondering is there any how i can make categories to get data from recent post (which is on the home page) also same content on the archive.
Please see:
http://postimage.org/image/4k9wun6bv/
Here is how i am thinking of getting post from archive and showing it on home page.
Please give me any help will be appreciated.
Thank you.
2 Trackbacks On “How to Add Tabber to Your WordPress Theme”
Post a Comment