All in one forum  - Applications | Games | E-Books | Music, Movies & Videos | Mobile Stuff | Live Discussions | Webmaster Stuff | Many More | Community to Hang Out and Stick to
Search Today's Posts Mark Forums Read

Go Back   Home > Tutorial Section > Programming > JavaScript
Reload this Page [Tutorial] Create a tabbed AJAX area in Wordpress
Forgot Password? Join Us!
JavaScript Post your JavaScript Related Tutorial Here

Notices
Your link here Your link here Your link here Your link here Your link here

Your Ad Here


Rate This Thread - Create a tabbed AJAX area in Wordpress.

Post New Thread Reply
Bookmarks
 
LinkBack Thread Tools Display Modes
Old 06-12-2008, 02:23 PM   #1 (permalink)
 
KoOL's Avatar
 
User Info
Join Date: Oct 2007
Location: In You Mind
Age: 26
Achievements Posts: 10,268
Casino Cash: $1066420

Total Points: 236,720,619,362.51
Donate

Reputation: 90403
KoOL has a reputation beyond reputeKoOL has a reputation beyond reputeKoOL has a reputation beyond reputeKoOL has a reputation beyond reputeKoOL has a reputation beyond reputeKoOL has a reputation beyond reputeKoOL has a reputation beyond reputeKoOL has a reputation beyond reputeKoOL has a reputation beyond reputeKoOL has a reputation beyond reputeKoOL has a reputation beyond repute


Awards Showcase
Administrator Of the Month Of Jan 
Total Awards: 1
Create a tabbed AJAX area in Wordpress

A lot of blogs are now opting for a tabbed area in the sidebar which contains some of the widgets that were previously on the sidebar, this saves space and makes the interface much more manageable.
This effect is achieved with a mix of Javascript and CSS and in this tutorial I will show you how to get it set up on your site, I will be using three tabs like on Help Developer, these will be Recent Posts, Categories and Archives. This tutorial is an extension of Justin Tadlock’s post here.
  1. Firstly download these two files: tabs.js and jquery.js
  2. Now open your header.php file in the wordpress template that you are using and add the following code between the <head> and </head> tags:
    <script type=”text/javascript” src=”<?php echo bloginfo(stylesheet_directory) .’/jquery.js’; ?>”></script>
    <script type=”text/javascript” src=”<?php echo bloginfo(stylesheet_directory) .’/tabs.js’; ?>”></script>
  3. Now go to the sidebar.php file and add this code where you would like it to appear on the sidebar, preferably nearer the top.
    <div id=”sidebartabs”>
    <div class=”tabbed”>
    <ul class=”tabs”>
    <li class=”t1″><a class=”t1 tab” title=”Recent Posts”>Recent Posts</a></li>
    <li class=”t2″><a class=”t2 tab” title=”Categories”>Categories</a></li>
    <li class=”t3″><a class=”t3 tab” title=”Archives”>Archives</a></li>
    </ul>
    <div class=”t1″>
    <ul>
    <?php wp_get_archives(’type=postbypost&limit=10&format=h tml’); ?>
    </ul>
    </div>
    <div class=”t2″>
    <ul>
    <?php wp_list_categories(”); ?>
    </ul>
    </div>
    <div class=”t3″>
    <ul>
    <?php wp_get_archives(’type=weekly&format=html’); ?>
    </ul>
    </div>
    </div>
    </div>
  4. No open the style.css file and add the following code somewhere in the stylesheet (take note of the red comments):
    #sidebartabs { /* acts as the widget container */
    clear:both;
    width:280px; /* this was an appropriate width for my sidebar, this may be different for you. */
    margin-left:10px;
    margin-bottom:20px;
    margin-top:0px;
    display:block;
    }
    #sidebartabs .tabbed div a { /* This is the styling for the links inside any of the tab areas */
    padding-left:3px;
    padding-top:5px;
    padding-bottom:5px;
    display:block;
    font-size:10pt;
    color:#999999;
    border-bottom:#ababab 1px solid;
    text-decoration: none;
    clear:both;
    text-align:left;
    margin-left:0px;
    margin-right:4px;
    margin-top:0;
    margin-bottom:0;
    width:270px;
    }
    #sidebartabs .tabbed div a:hover { /* This is the styling when you hover over links in the tabbed area */
    color:#777777;
    text-decoration: none;
    }
    .tabbed { /* This is the tab area container */
    margin-bottom:10px;
    clear:both;
    margin-top:0px;
    }
    .tabbed ul.tabs { /* This is the styling for the tabs themselves */
    float: left;
    display: inline;
    width: 100%;
    margin: 0;
    padding-bottom:10px;
    padding-left:10px;
    padding-right:10px;
    padding-top:0px;
    }
    .tabbed ul.tabs li { /* Styling for each individual tab */
    list-style-type: none;
    float: left;
    margin: 0;
    padding: 0;
    z-index:10;
    }
    .tabbed ul.tabs li a { /* Styling for the link on the tab */
    overflow: hidden;
    display: block;
    margin: 0 1px 0 0;
    padding: 10px 12px;
    background-color:#efefef;
    cursorointer;
    }
    .tabbed ul.tabs li a:hover { /* This is the styling for when you hover over a tab */
    text-decoration:none;
    }
    .tabbed ul.tabs li a.tab-current { /* The styling for the activated tab */
    background-color:#e8e8e8;
    border-left:1px solid #CCCCCC;
    border-right:1px solid #CCCCCC;
    border-top:#cda2a2 solid 2px;
    }
    .tabbed div { /* This is the tab area for each tab, the inside of the tab */
    float: left;
    display: block;
    background-color:#e8e8e8;
    padding:10px;
    clear:both;
    width:100%;
    padding-bottom:20px;
    border:1px solid #CCCCCC;
    border-bottom:#cda2a2 solid 2px;
    margin-top:-1px;
    z-index:1;
    }
    .tabbed div.t2, .tabbed div.t3, .tabbed div.t4 {
    display: none;
    }
  5. This should produce something like the tabbed are on the Help Developer sidebar. You can change the styling above to add images to the tabs or change the sizing. You can also add more tabs by adding the following lines:
    <li class=”t4″><a class=”t4 tab” title=”NewTabName”>NewTabName</a></li> under the <li class=”t3″><a class=”t3 tab” title=”Archives”>Archives</a></li>
    AND THEN…
    <div class=”t4″>
    INSIDE CONTENT
    </div>
    AND SO ON…

For Download Links U need to Press Thanks Button
My Goal 2: (Complete 10000)

Please don't PM me For Posts, Request and Not Working Threads. Use Button.
KoOL is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply
The Following User Says Thank You to KoOL For This Useful Post:
barnick (06-28-2008)
Click here to Donate to remove the Adverts.
Your Ad Here
Post New Thread Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AIO Release -- Wordpress Traffic -- Set It And Forget It -- Put Your Wordpress Blog on Autopilot.. Admins Direct Downloads Listing 0 05-13-2008 04:01 AM
Intellitabs v2.2 - Tabbed browsing for MS Office, NOW SUPPORTS OFFICE 2007 Zoe Appz Zone 0 10-09-2007 08:07 AM
Professional Ajax KoOL Ebooks,tutorials & Other Stuff 0 09-29-2007 12:25 PM
Wireless Ad Hoc Networking: Personal-Area, Local-Area, and the Sensory-Area Networks sharad_mlk Ebooks,tutorials & Other Stuff 0 05-10-2007 01:04 AM
Beginning Ajax with ASP.NET sharad_mlk Ebooks,tutorials & Other Stuff 1 04-24-2007 02:16 AM



Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles

RapidShare Links PhazeDDL Warez
PhazeDDL Warez