How To Add Tabbed Widget To Thesis WordPress Theme Sidebar

by Simrandeep on July 10, 2010

in Thesis Customization

Do you like this post?

Few days back I installed Thesis WordPress theme on my blog as it is the best SEO optimized wordpress theme.  Today I’m going to share my first tutorial on thesis customization. In this tutorial I’ll share how to add tabbed widget to thesis wordpress theme.

If you are not using thesis then you can get your copy from here – Get thesis. If you are already using it on your blog then you can move further to the tutorial part. In this tutorial I’m using the Domtab script designed by onlinetools.

Here is the screenshot of the tabbed widget:

How to add tabbed widget

  1. First of all download the zip file and upload the domtab.js file included in the zip file to your root directory.
  2. Go to Page Options and paste the following  JavaScript code in the JavaScript box under Home Page Options.
    <script type="text/javascript" src="domtab.js"></script>
  3. Now copy and paste the following code to your custom.css file.
    div.domtab{
    width:100%;
    font-size:12px;
    line-height:20px;
    }
    ul.domtabs{
    float:left;
    width:100%;
    margin:2em 0 0 0;
    list-style: none;
    }
    ul.domtabs li{
    float:left;
    padding:0 .5em 0 0;
    }
    ul.domtabs a:link,
    ul.domtabs a:visited,
    ul.domtabs a:active,
    ul.domtabs a:hover{
    display:block;
    background:#FFFFFF;
    padding:5px 15px;
    color:#000;
    text-decoration:none;
    border-top:1px solid #E6E6E6;
    border-left:1px solid #E6E6E6;
    border-right:1px solid #E6E6E6;
    }
    ul.domtabs a:hover{
    }
    div.domtab div{
    clear:both;
    width:auto;
    background:#F8F8F8;
    color:#000;
    padding:1em;
    border: 1px solid #E6E6E6;
    }
    div.domtab div ul{
    list-style: none;
    }
    ul.domtabs li.active a:link,
    ul.domtabs li.active a:visited,
    ul.domtabs li.active a:active,
    ul.domtabs li.active a:hover{
    background:#E6E6E6;
    color:#000;
    }
    div.domtab div a:link,
    div.domtab div a:visited,
    div.domtab div a:active {
    color:#3800AA;
    font-weight:bold;
    }
  4. Save your custom.css file.
  5. Now copy and paste the following code in custom_functions.php file.
    function tabbed_widget() { ?>
    <div>
    <ul>
    <li><a href="#t1">Tab 1</a></li>
    <li><a href="#t2">Tab 2</a></li>
    <li><a href="#t3">Tab 3</a></li>
    </ul>
    <div>
    <a name="t1" id="t1"></a>
    <p>Insert the Tab 1 content here</p>
    </div>
    <div>
    <h2><a name="t2" id="t2"></a></h2>
    <p>Insert the Tab 2 content here</p>
    </div>
    <div>
    <h2><a name="t3" id="t3"></a></h2>
    <p>Insert the Tab 3 content here</p>
    </div>
    </div>
    <?php }
    add_action('thesis_hook_before_sidebars', 'tabbed_widget');
  6. Save custom_functions.php file.

That’s all to add a tabbed widget to your thesis theme sidebar. You can customize it according to your theme in custom.css file. If you need any help, do ask in comments.

Insert the Tab 1 content here

Incoming search terms:

Article by Simrandeep

Simrandeep is the owner and editor-in-chief of TricksDaddy. He is a part-time blogger from India. Catch him on Facebook and Twitter.

Simrandeep has written 394 awesome articles.

{ 7 comments… read them below or add one }

Shanker Bakshi July 11, 2010 at 9:48 am

Thats something i was looking for; it help utilise your sidebar space for other cool stuff.

Reply

TechGopal July 13, 2010 at 3:34 pm

can it work with my site theme also??
i am not using thesis theme bt i want to add this tab on my site…….

Reply

Simrandeep July 13, 2010 at 11:30 pm

Yes, it will work with any wordpress them but for non thesis theme you have to put the coding given in step 5 in sidebar.php file and remove the first and last two lines.

If you are facing any problem, do not hesitate to leave a comment. I’m always here to help you :)

Reply

Kimberly Castleberry July 15, 2010 at 6:25 am

The download link is pointing to http://www.tricksdaddy.com/files/domtab.js and thus broke. It needs to point to http://www.tricksdaddy.com/files/domtab.zip which worked just fine.

Thanks, I’ve been looking for this a while!
Kimberly

Reply

Simrandeep July 15, 2010 at 8:30 am

Thanks for poiting out Kimberly. The download link is updated now :)

Reply

Jean July 18, 2010 at 10:07 pm

thank you, but I can’t figure out where are page option and home page option to put the javascript code

Reply

Mike August 24, 2010 at 7:09 am

Right I love to Interest this topic. Thank you for the information.

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: