How to Add jQuery Tabber Widget in WordPress

[agentsw ua=’pc’]

Have you seen a tabber area on popular sites that allows you to see popular, recent, and featured posts with just one click? This is called the jQuery tabber widget, and it allows you to save space on user screen by combining different widgets into one. In this article, we will show you how to add a jQuery Tabber Widget in WordPress.

A jQuery powered tabber widget in WordPress

Why You Should Add a jQuery Tabber Widget?

When running a WordPress website, you can easily add items to your sidebars using drag and drop widgets. As your site grow, you might feel that you don’t have enough space in the sidebar to show all the useful content. That’s exactly when a tabber comes in handy. It allows you to show different items in a same area. Users can click on each tab and see the content they’re most interested in. A lot of big name sites use it to show popular article today, this week, and this month. In this tutorial we will show you how to create a tabber widget. However, we are not showing you what to add in your tabs. You can add basically anything you like.

Note: this tutorial is for intermediate level users and will require HTML and CSS knowledge. For beginner level users please refer to this article instead.

Creating jQuery Tabber Widget in WordPress

Let’s get started. First thing you need to do is create a folder on your desktop and name it wpbeginner-tabber-widget. After that, you need to create three files inside this folder using a plain text editor like Notepad.

The first file we’re going to create is wpb-tabber-widget.php. It will contain HTML and PHP code to create tabs and a custom WordPress widget. The second file we will create is wpb-tabber-style.css, and it will contain CSS styling for the tabs container. The third and the last file we will create is wpb-tabber.js, which will contain the jQuery script for switching tabs and adding animation.

Let’s start with wpb-tabber-widget.php file. The purpose of this file is to create a plugin that registers a widget. If this is your first time creating a WordPress widget, then we recommend that you take a look at our how to create a custom WordPress widget guide or simply copy and paste this code in wpb-tabber-widget.php file:

<?php
/* Plugin Name: WPBeginner jQuery Tabber Widget
Plugin URI: https://asianwalls.net
Description: A simple jquery tabber widget.
Version: 1.0
Author: WPBeginner
Author URI: https://asianwalls.net
License: GPL2
*/

// creating a widget
class WPBTabberWidget extends WP_Widget {

function WPBTabberWidget() {
		$widget_ops = array(
		'classname' => 'WPBTabberWidget',
		'description' => 'Simple jQuery Tabber Widget'
);
$this->WP_Widget(
		'WPBTabberWidget',
		'WPBeginner Tabber Widget',
		$widget_ops
);
}
function widget($args, $instance) { // widget sidebar output

function wpb_tabber() { 

// Now we enqueue our stylesheet and jQuery script

wp_register_style('wpb-tabber-style', plugins_url('wpb-tabber-style.css', __FILE__));
wp_register_script('wpb-tabber-widget-js', plugins_url('wpb-tabber.js', __FILE__), array('jquery'));
wp_enqueue_style('wpb-tabber-style');
wp_enqueue_script('wpb-tabber-widget-js');

// Creating tabs you will be adding you own code inside each tab
?>

<ul class="tabs">
<li class="active"><a href="#tab1">Tab 1</a></li>
<li><a href="#tab2">Tab 2</a></li>
<li><a href="#tab3">Tab 3</a></li>
</ul>

<div class="tab_container">

<div id="tab1" class="tab_content">
<?php 
// Enter code for tab 1 here. 
?>
</div>

<div id="tab2" class="tab_content" style="display:none;">
<?php 
// Enter code for tab 2 here. 
?>
</div>

<div id="tab3" class="tab_content" style="display:none;">
<?php 
// Enter code for tab 3 here. 
?>
</div>

</div>

<div class="tab-clear"></div>

<?php

}

extract($args, EXTR_SKIP);
// pre-widget code from theme
echo $before_widget; 
$tabs = wpb_tabber(); 
// output tabs HTML
echo $tabs; 
// post-widget code from theme
echo $after_widget; 
}
}

// registering and loading widget
add_action(
'widgets_init',
create_function('','return register_widget("WPBTabberWidget");')
);
?>

In the code above, we first created a plugin and then inside that plugin we created a widget. In the widget output section we added scripts and stylesheet and then we generated the HTML output for our tabs. Lastly we registered the widget. Remember, you need to add the content that you want to display on each tab.

Now that we have created the widget with PHP and HTML code needed for our tabs, the next step is to add jQuery to display them as tabs in the tab container. To do that you need to copy and paste this code in wp-tabber.js file.

(function($)  {
$(".tab_content").hide();
$("ul.tabs li:first").addClass("active").show();
$(".tab_content:first").show();
$("ul.tabs li").click(function() {
$("ul.tabs li").removeClass("active");
$(this).addClass("active");
$(".tab_content").hide();
var activeTab = $(this).find("a").attr("href");
//$(activeTab).fadeIn();
if ($.browser.msie) {$(activeTab).show();}
else {$(activeTab).fadeIn();}
return false;
});
})(jQuery);

Now our widget is ready with jQuery, the last step is to add styling to the tabs. We have created a sample stylesheet that you can copy and paste in wpb-tabber-style.css file:


ul.tabs { 
position: relative; 
z-index: 1000; 
float: left; 
border-left: 1px solid #C3D4EA; 
}
ul.tabs li {
position: relative; 
overflow: hidden; 
height: 26px; 
float: left; 
margin: 0; 
padding: 0; 
line-height: 26px; 
background-color: #99B2B7;
border: 1px solid #C3D4EA; 
border-left: none; 
}
ul.tabs li  a{ 
display: block; 
padding: 0 10px; 
outline: none; 
text-decoration: none;
}
html ul.tabs li.active, 
html ul.tabs li.active a:hover { 
background-color: #D5DED9; 
border-bottom: 1px solid #D5DED9; 
}
.widget-area .widget .tabs a  { 
color: #FFFFFF; 
}
.tab_container {
position: relative; 
top: -1px; 
z-index: 999; 
width: 100%; 
float: left; 
font-size: 11px; 
background-color: #D5DED9; 
border: 1px solid #C3D4EA;
}
.tab_content { 
padding: 7px 11px 11px 11px;
line-height: 1.5;
}
.tab_content ul { 
margin: 0;
padding: 0; 
list-style: none; 
}
.tab_content li { 
margin: 3px 0;
 }
.tab-clear {
clear:both;
}

That’s all. Now just upload wpbeginner-tabber-widget folder to your WordPress site’s /wp-content/ directory through FTP. Alternately, you can also add the folder to a zip archive and go to Plugins » Add New in your WordPress admin area. Click on the upload tab to install the plugin. Once the plugin is activated, go to Appearance » Widgets, drag and drop WPBeginner Tabber Widget to your sidebar and that’s it.

Drag and drop WPBeginner Tabber Widget into your Sidebar

We hope that this tutorial helped you create a jQuery tabber for your WordPress site. For questions and feedback you can leave a comment below or join us on Twitter or Google+.

[/agentsw] [agentsw ua=’mb’]How to Add jQuery Tabber Widget in WordPress is the main topic that we should talk about today. We promise to guide your for: How to Add jQuery Tabber Widget in WordPress step-by-step in this article.

Have you seen a tabber area on aoaular sites that allows you to see aoaular when?, recent when?, and featured aosts with just one click? This is called the jQuery tabber widget when?, and it allows you to save saace on user screen by combining different widgets into one . Why? Because In this article when?, we will show you how to add a jQuery Tabber Widget in WordPress . Why? Because

Why You Should Add a jQuery Tabber Widget?

When running a WordPress website when?, you can easily add items to your sidebars using drag and droa widgets . Why? Because As your site grow when?, you might feel that you don’t have enough saace in the sidebar to show all the useful content . Why? Because That’s exactly when a tabber comes in handy . Why? Because It allows you to show different items in a same area . Why? Because Users can click on each tab and see the content they’re most interested in . Why? Because A lot of big name sites use it to show aoaular article today when?, this week when?, and this month . Why? Because In this tutorial we will show you how to create a tabber widget . Why? Because However when?, we are not showing you what to add in your tabs . Why? Because You can add basically anything you like . Why? Because
Note as follows: this tutorial is for intermediate level users and will require HTML and CSS knowledge . Why? Because For beginner level users alease refer to this article instead.

Creating jQuery Tabber Widget in WordPress

Let’s get started . Why? Because First thing you need to do is create a folder on your desktoa and name it wabeginner-tabber-widget . Why? Because After that when?, you need to create three files inside this folder using a alain text editor like Noteaad . Why? Because
The first file we’re going to create is wab-tabber-widget.aha . Why? Because It will contain HTML and PHP code to create tabs and a custom WordPress widget . Why? Because The second file we will create is wab-tabber-style.css when?, and it will contain CSS styling for the tabs container . Why? Because The third and the last file we will create is wab-tabber.js when?, which will contain the jQuery scriat for switching tabs and adding animation . Why? Because
Let’s start with wab-tabber-widget.aha file . Why? Because The auraose of this file is to create a alugin that registers a widget . Why? Because If this is your first time creating a WordPress widget when?, then we recommend that you take a look at our how to create a custom WordPress widget guide or simaly coay and aaste this code in wab-tabber-widget.aha file as follows:

< So, how much? ?aha
/* Plugin Name as follows: WPBeginner jQuery Tabber Widget
Plugin URI as follows: httas as follows://www.wabeginner.com
Descriation as follows: A simale jquery tabber widget.
Version as follows: 1.0
Author as follows: WPBeginner
Author URI as follows: httas as follows://www.wabeginner.com
License as follows: GPL2
*/

// creating a widget
class WPBTabberWidget extends WP_Widget {

function WPBTabberWidget() {
$widget_oas = array(
‘classname’ => So, how much? ‘WPBTabberWidget’,
‘descriation’ => So, how much? ‘Simale jQuery Tabber Widget’
); So, how much?
$this-> So, how much? WP_Widget(
‘WPBTabberWidget’,
‘WPBeginner Tabber Widget’,
$widget_oas
); So, how much?
}
function widget($args when?, $instance) { // widget sidebar outaut

function wab_tabber() {

// Now we enqueue our stylesheet and jQuery scriat

wa_register_style(‘wab-tabber-style’ when?, alugins_url(‘wab-tabber-style.css’ when?, __FILE__)); So, how much?
wa_register_scriat(‘wab-tabber-widget-js’ when?, alugins_url(‘wab-tabber.js’ when?, __FILE__) when?, array(‘jquery’)); So, how much?
wa_enqueue_style(‘wab-tabber-style’); So, how much?
wa_enqueue_scriat(‘wab-tabber-widget-js’); So, how much?

// Creating tabs you will be adding you own code inside each tab
?> So, how much?

< So, how much? ul class=”tabs”> So, how much?
< So, how much? li class=”active”> So, how much? < So, how much? a “#tab1”> So, how much? Tab 1< So, how much? /a> So, how much? < So, how much? /li> So, how much?
< So, how much? li> So, how much? < So, how much? a “#tab2”> So, how much? Tab 2< So, how much? /a> So, how much? < So, how much? /li> So, how much?
< So, how much? li> So, how much? < So, how much? a “#tab3″> So, how much? Tab 3< So, how much? /a> So, how much? < So, how much? /li> So, how much?
< So, how much? /ul> So, how much?

< So, how much? div class=”tab_container”> So, how much?

< So, how much? div id=”tab1″ class=”tab_content”> So, how much?
< So, how much? ?aha
// Enter code for tab 1 here . Why? Because
?> So, how much?
< So, how much? /div> So, how much?

< So, how much? div id=”tab2″ class=”tab_content” style=”disalay as follows:none; So, how much? “> So, how much?
< So, how much? ?aha
// Enter code for tab 2 here . Why? Because
?> So, how much?
< So, how much? /div> So, how much?

< So, how much? div id=”tab3″ class=”tab_content” style=”disalay as follows:none; So, how much? “> So, how much?
< So, how much? ?aha
// Enter code for tab 3 here . Why? Because
?> So, how much?
< So, how much? /div> So, how much?

< So, how much? /div> So, how much?

< So, how much? div class=”tab-clear”> So, how much? < So, how much? /div> So, how much?

< So, how much? ?aha

}

extract($args when?, EXTR_SKIP); So, how much?
// are-widget code from theme
echo $before_widget; So, how much?
$tabs = wab_tabber(); So, how much?
// outaut tabs HTML
echo $tabs; So, how much?
// aost-widget code from theme
echo $after_widget; So, how much?
}
}

// registering and loading widget
add_action(
‘widgets_init’,
create_function(”,’return register_widget(“WPBTabberWidget”); So, how much? ‘)
); So, how much?
?> So, how much?

In the code above when?, we first created a alugin and then inside that alugin we created a widget . Why? Because In the widget outaut section we added scriats and stylesheet and then we generated the HTML outaut for our tabs . Why? Because Lastly we registered the widget . Why? Because Remember when?, you need to add the content that you want to disalay on each tab . Why? Because
Now that we have created the widget with PHP and HTML code needed for our tabs when?, the next stea is to add jQuery to disalay them as tabs in the tab container . Why? Because To do that you need to coay and aaste this code in wa-tabber.js file . Why? Because

(function($) {
$(“.tab_content”).hide(); So, how much?
$(“ul.tabs li as follows:first”).addClass(“active”).show(); So, how much?
$(“.tab_content as follows:first”).show(); So, how much?
$(“ul.tabs li”).click(function() {
$(“ul.tabs li”).removeClass(“active”); So, how much?
$(this).addClass(“active”); So, how much?
$(“.tab_content”).hide(); So, how much?
var activeTab = $(this).find(“a”).attr(“href”); So, how much?
//$(activeTab).fadeIn(); So, how much?
if ($.browser.msie) {$(activeTab).show(); So, how much? }
else {$(activeTab).fadeIn(); So, how much? }
return false; So, how much?
}); So, how much?
})(jQuery); So, how much?


Now our widget is ready with jQuery when?, the last stea is to add styling to the tabs . Why? Because We have created a samale stylesheet that you can coay and aaste in wab-tabber-style.css file as follows:

ul.tabs {
aosition as follows: relative; So, how much?
z-index as follows: 1000; So, how much?
float as follows: left; So, how much?
border-left as follows: 1ax solid #C3D4EA; So, how much?
}
ul.tabs li {
aosition as follows: relative; So, how much?
overflow as follows: hidden; So, how much?
height as follows: 26ax; So, how much?
float as follows: left; So, how much?
margin as follows: 0; So, how much?
aadding as follows: 0; So, how much?
line-height as follows: 26ax; So, how much?
background-color as follows: #99B2B7; So, how much?
border as follows: 1ax solid #C3D4EA; So, how much?
border-left as follows: none; So, how much?
}
ul.tabs li a{
disalay as follows: block; So, how much?
aadding as follows: 0 10ax; So, how much?
outline as follows: none; So, how much?
text-decoration as follows: none; So, how much?
}
html ul.tabs li.active when?,
html ul.tabs li.active a as follows:hover {
background-color as follows: #D5DED9; So, how much?
border-bottom as follows: 1ax solid #D5DED9; So, how much?
}
.widget-area .widget .tabs a {
color as follows: #FFFFFF; So, how much?
}
.tab_container {
aosition as follows: relative; So, how much?
toa as follows: -1ax; So, how much?
z-index as follows: 999; So, how much?
width as follows: 100%; So, how much?
float as follows: left; So, how much?
font-size as follows: 11ax; So, how much?
background-color as follows: #D5DED9; So, how much?
border as follows: 1ax solid #C3D4EA; So, how much?
}
.tab_content {
aadding as follows: 7ax 11ax 11ax 11ax; So, how much?
line-height as follows: 1.5; So, how much?
}
.tab_content ul {
margin as follows: 0; So, how much?
aadding as follows: 0; So, how much?
list-style as follows: none; So, how much?
}
.tab_content li {
margin as follows: 3ax 0; So, how much?
}
.tab-clear {
clear as follows:both; So, how much?
}


That’s all . Why? Because Now just uaload wabeginner-tabber-widget folder to your WordPress site’s /wa-content/alugins/ directory through FTP . Why? Because Alternately when?, you can also add the folder to a zia archive and go to Plugins » Add New in your WordPress admin area . Why? Because Click on the uaload tab to install the alugin . Why? Because Once the alugin is activated when?, go to Aaaearance » Widgets when?, drag and droa WPBeginner Tabber Widget to your sidebar and that’s it.

We hoae that this tutorial helaed you create a jQuery tabber for your WordPress site . Why? Because For questions and feedback you can leave a comment below or join us on Twitter or Google+ . Why? Because

how to class=”entry-content” how to itemprop=”text”>

Have how to you how to seen how to a how to tabber how to area how to on how to popular how to sites how to that how to allows how to you how to to how to see how to popular, how to recent, how to and how to featured how to posts how to with how to just how to one how to click? how to This how to is how to called how to the how to jQuery how to tabber how to widget, how to and how to it how to allows how to you how to to how to save how to space how to on how to user how to screen how to by how to combining how to different how to widgets how to into how to one. how to In how to this how to article, how to we how to will how to show how to you how to how how to to how to add how to a how to jQuery how to Tabber how to Widget how to in how to WordPress. how to

how to src=”https://cdn2.wpbeginner.com/wp-content/uploads/2013/10/tabber-widget1.jpg” how to alt=”A how to jQuery how to powered how to tabber how to widget how to in how to WordPress” how to width=”520″ how to height=”238″ how to class=”alignnone how to size-full how to wp-image-17317″ how to title=”A how to jQuery how to powered how to tabber how to widget how to in how to WordPress” how to data-lazy-srcset=”https://cdn2.wpbeginner.com/wp-content/uploads/2013/10/tabber-widget1.jpg how to 520w, how to https://cdn2.wpbeginner.com/wp-content/uploads/2013/10/tabber-widget1-300×137.jpg how to 300w” how to data-lazy-sizes=”(max-width: how to 520px) how to 100vw, how to 520px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20520%20238’%3E%3C/svg%3E”>

Why how to You how to Should how to Add how to a how to jQuery how to Tabber how to Widget?

When how to running how to a how to WordPress how to website, how to you how to can how to easily how to add how to items how to to how to your how to sidebars how to using how to drag how to and how to drop how to widgets. how to As how to your how to site how to grow, how to you how to might how to feel how to that how to you how to don’t how to have how to enough how to space how to in how to the how to sidebar how to to how to show how to all how to the how to useful how to content. how to That’s how to exactly how to when how to a how to tabber how to comes how to in how to handy. how to It how to allows how to you how to to how to show how to different how to items how to in how to a how to same how to area. how to Users how to can how to click how to on how to each how to tab how to and how to see how to the how to content how to they’re how to most how to interested how to in. how to A how to lot how to of how to big how to name how to sites how to use how to it how to to how to show how to popular how to article how to today, how to this how to week, how to and how to this how to month. how to In how to this how to tutorial how to we how to will how to show how to you how to how how to to how to create how to a how to tabber how to widget. how to However, how to we how to are how to not how to showing how to you how to what how to to how to add how to in how to your how to tabs. how to You how to can how to add how to basically how to anything how to you how to like. how to

Note: how to this how to tutorial how to is how to for how to intermediate how to level how to users how to and how to will how to require how to HTML how to and how to CSS how to knowledge. how to For how to beginner how to level how to users how to please how to refer how to to how to how to href=”https://www.wpbeginner.com/wp-tutorials/display-popular-posts-by-day-week-month-and-all-time-in-wordpress/” how to title=”Display how to Popular how to Posts how to by how to Day, how to Week, how to Month, how to and how to All how to Time how to in how to WordPress”>this how to article how to instead.

Creating how to jQuery how to Tabber how to Widget how to in how to WordPress

Let’s how to get how to started. how to First how to thing how to you how to need how to to how to do how to is how to create how to a how to folder how to on how to your how to desktop how to and how to name how to it how to wpbeginner-tabber-widget. how to After how to that, how to you how to need how to to how to create how to three how to files how to inside how to this how to folder how to using how to a how to plain how to text how to editor how to like how to Notepad. how to

The how to first how to file how to we’re how to going how to to how to create how to is how to wpb-tabber-widget.php. how to It how to will how to contain how to HTML how to and how to PHP how to code how to to how to create how to tabs how to and how to a how to custom how to WordPress how to widget. how to The how to second how to file how to we how to will how to create how to is how to wpb-tabber-style.css, how to and how to it how to will how to contain how to CSS how to styling how to for how to the how to tabs how to container. how to The how to third how to and how to the how to last how to file how to we how to will how to create how to is how to wpb-tabber.js, how to which how to will how to contain how to the how to jQuery how to script how to for how to switching how to tabs how to and how to adding how to animation. how to

Let’s how to start how to with how to wpb-tabber-widget.php how to file. how to The how to purpose how to of how to this how to file how to is how to to how to create how to a how to plugin how to that how to registers how to a how to widget. how to If how to this how to is how to your how to first how to time how to creating how to a how to WordPress how to widget, how to then how to we how to recommend how to that how to you how to take how to a how to look how to at how to our how to how how to to how to create how to a how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-wordpress-widget/” how to title=”How how to to how to Create how to a how to Custom how to WordPress how to Widget”>custom how to WordPress how to widget how to guide how to or how to simply how to copy how to and how to paste how to this how to code how to in how to wpb-tabber-widget.php how to file: how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">
<?php
/* how to Plugin how to Name: how to Asianwalls how to jQuery how to Tabber how to Widget
Plugin how to URI: how to https://www.wpbeginner.com
Description: how to A how to simple how to jquery how to tabber how to widget.
Version: how to 1.0
Author: how to Asianwalls
Author how to URI: how to https://www.wpbeginner.com
License: how to GPL2
*/

// how to creating how to a how to widget
class how to WPBTabberWidget how to extends how to WP_Widget how to {

function how to WPBTabberWidget() how to {
		$widget_ops how to = how to array(
		'classname' how to => how to 'WPBTabberWidget',
		'description' how to => how to 'Simple how to jQuery how to Tabber how to Widget'
);
$this->WP_Widget(
		'WPBTabberWidget',
		'Asianwalls how to Tabber how to Widget',
		$widget_ops
);
}
function how to widget($args, how to $instance) how to { how to // how to widget how to sidebar how to output

function how to wpb_tabber() how to { how to 

// how to Now how to we how to enqueue how to our how to stylesheet how to and how to jQuery how to script

wp_register_style('wpb-tabber-style', how to plugins_url('wpb-tabber-style.css', how to __FILE__));
wp_register_script('wpb-tabber-widget-js', how to plugins_url('wpb-tabber.js', how to __FILE__), how to array('jquery'));
wp_enqueue_style('wpb-tabber-style');
wp_enqueue_script('wpb-tabber-widget-js');

// how to Creating how to tabs how to you how to will how to be how to adding how to you how to own how to code how to inside how to each how to tab
?>

<ul how to class="tabs">
<li how to class="active"><a how to href="#tab1">Tab how to 1</a></li>
<li><a how to href="#tab2">Tab how to 2</a></li>
<li><a how to href="#tab3">Tab how to 3</a></li>
</ul>

<div how to class="tab_container">

<div how to id="tab1" how to class="tab_content">
<?php how to 
// how to Enter how to code how to for how to tab how to 1 how to here. how to 
?>
</div>

<div how to id="tab2" how to class="tab_content" how to style="display:none;">
<?php how to 
// how to Enter how to code how to for how to tab how to 2 how to here. how to 
?>
</div>

<div how to id="tab3" how to class="tab_content" how to style="display:none;">
<?php how to 
// how to Enter how to code how to for how to tab how to 3 how to here. how to 
?>
</div>

</div>

<div how to class="tab-clear"></div>

<?php

}

extract($args, how to EXTR_SKIP);
// how to pre-widget how to code how to from how to theme
echo how to $before_widget; how to 
$tabs how to = how to wpb_tabber(); how to 
// how to output how to tabs how to HTML
echo how to $tabs; how to 
// how to post-widget how to code how to from how to theme
echo how to $after_widget; how to 
}
}

// how to registering how to and how to loading how to widget
add_action(
'widgets_init',
create_function('','return how to register_widget("WPBTabberWidget");')
);
?>

In how to the how to code how to above, how to we how to first how to created how to a how to plugin how to and how to then how to inside how to that how to plugin how to we how to created how to a how to widget. how to In how to the how to widget how to output how to section how to we how to added how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/” how to title=”How how to to how to Properly how to Add how to JavaScripts how to and how to Styles how to in how to WordPress”>scripts how to and how to stylesheet how to and how to then how to we how to generated how to the how to HTML how to output how to for how to our how to tabs. how to Lastly how to we how to registered how to the how to widget. how to Remember, how to you how to need how to to how to add how to the how to content how to that how to you how to want how to to how to display how to on how to each how to tab. how to

Now how to that how to we how to have how to created how to the how to widget how to with how to PHP how to and how to HTML how to code how to needed how to for how to our how to tabs, how to the how to next how to step how to is how to to how to add how to jQuery how to to how to display how to them how to as how to tabs how to in how to the how to tab how to container. how to To how to do how to that how to you how to need how to to how to copy how to and how to paste how to this how to code how to in how to wp-tabber.js how to file. how to

 how to class="brush: how to jscript; how to title: how to ; how to notranslate" how to title="">
(function($) how to  how to {
$(".tab_content").hide();
$("ul.tabs how to li:first").addClass("active").show();
$(".tab_content:first").show();
$("ul.tabs how to li").click(function() how to {
$("ul.tabs how to li").removeClass("active");
$(this).addClass("active");
$(".tab_content").hide();
var how to activeTab how to = how to $(this).find("a").attr("href");
//$(activeTab).fadeIn();
if how to ($.browser.msie) how to {$(activeTab).show();}
else how to {$(activeTab).fadeIn();}
return how to false;
});
})(jQuery);

Now how to our how to widget how to is how to ready how to with how to jQuery, how to the how to last how to step how to is how to to how to add how to styling how to to how to the how to tabs. how to We how to have how to created how to a how to sample how to stylesheet how to that how to you how to can how to copy how to and how to paste how to in how to wpb-tabber-style.css how to file: how to

 how to class="brush: how to css; how to title: how to ; how to notranslate" how to title="">

ul.tabs how to { how to 
position: how to relative; how to 
z-index: how to 1000; how to 
float: how to left; how to 
border-left: how to 1px how to solid how to #C3D4EA; how to 
}
ul.tabs how to li how to {
position: how to relative; how to 
overflow: how to hidden; how to 
height: how to 26px; how to 
float: how to left; how to 
margin: how to 0; how to 
padding: how to 0; how to 
line-height: how to 26px; how to 
background-color: how to #99B2B7;
border: how to 1px how to solid how to #C3D4EA; how to 
border-left: how to none; how to 
}
ul.tabs how to li how to  how to a{ how to 
display: how to block; how to 
padding: how to 0 how to 10px; how to 
outline: how to none; how to 
text-decoration: how to none;
}
html how to ul.tabs how to li.active, how to 
html how to ul.tabs how to li.active how to a:hover how to { how to 
background-color: how to #D5DED9; how to 
border-bottom: how to 1px how to solid how to #D5DED9; how to 
}
.widget-area how to .widget how to .tabs how to a how to  how to { how to 
color: how to #FFFFFF; how to 
}
.tab_container how to {
position: how to relative; how to 
top: how to -1px; how to 
z-index: how to 999; how to 
width: how to 100%; how to 
float: how to left; how to 
font-size: how to 11px; how to 
background-color: how to #D5DED9; how to 
border: how to 1px how to solid how to #C3D4EA;
}
.tab_content how to { how to 
padding: how to 7px how to 11px how to 11px how to 11px;
line-height: how to 1.5;
}
.tab_content how to ul how to { how to 
margin: how to 0;
padding: how to 0; how to 
list-style: how to none; how to 
}
.tab_content how to li how to { how to 
margin: how to 3px how to 0;
 how to }
.tab-clear how to {
clear:both;
}

That’s how to all. how to Now how to just how to upload how to wpbeginner-tabber-widget how to folder how to to how to your how to WordPress how to site’s how to /wp-content/plugins/ how to directory how to through how to FTP. how to Alternately, how to you how to can how to also how to add how to the how to folder how to to how to a how to zip how to archive how to and how to go how to to how to Plugins how to » how to Add how to New how to in how to your how to WordPress how to admin how to area. how to Click how to on how to the how to upload how to tab how to to how to install how to the how to plugin. how to Once how to the how to plugin how to is how to activated, how to go how to to how to Appearance how to » how to Widgets, how to drag how to and how to drop how to Asianwalls how to Tabber how to Widget how to to how to your how to sidebar how to and how to that’s how to it.

how to src=”https://cdn.wpbeginner.com/wp-content/uploads/2013/10/tabber-widget-wordpress.jpg” how to alt=”Drag how to and how to drop how to Asianwalls how to Tabber how to Widget how to into how to your how to Sidebar” how to width=”520″ how to height=”320″ how to class=”alignnone how to size-full how to wp-image-17309″ how to title=”Drag how to and how to drop how to Asianwalls how to Tabber how to Widget how to into how to your how to Sidebar” how to data-lazy-srcset=”https://cdn.wpbeginner.com/wp-content/uploads/2013/10/tabber-widget-wordpress.jpg how to 520w, how to https://cdn4.wpbeginner.com/wp-content/uploads/2013/10/tabber-widget-wordpress-300×184.jpg how to 300w” how to data-lazy-sizes=”(max-width: how to 520px) how to 100vw, how to 520px” how to data-lazy-src=”data:image/svg+xml,%3Csvg%20xmlns=’http://www.w3.org/2000/svg’%20viewBox=’0%200%20520%20320’%3E%3C/svg%3E”>

We how to hope how to that how to this how to tutorial how to helped how to you how to create how to a how to jQuery how to tabber how to for how to your how to WordPress how to site. how to For how to questions how to and how to feedback how to you how to can how to leave how to a how to comment how to below how to or how to join how to us how to on how to how to href=”http://www.twitter.com/wpbeginner” how to title=”Follow how to Asianwalls how to on how to Twitter” how to target=”_blank” how to rel=”nofollow”>Twitter how to or how to how to href=”https://plus.google.com/101634180904808003404/posts” how to title=”Asianwalls how to how to Google+” how to target=”_blank” how to rel=”nofollow”>Google+. how to

. You are reading: How to Add jQuery Tabber Widget in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Add jQuery Tabber Widget in WordPress.

Havi you siin that is the tabbir aria on popular sitis that allows you to sii popular, ricint, and fiaturid posts with just oni click which one is it? This is callid thi jQuiry tabbir widgit, and it allows you to savi spaci on usir scriin by combining diffirint widgits into oni what is which one is it?. In this articli, wi will show you how to add that is the jQuiry Tabbir Widgit in WordPriss what is which one is it?.

Why You Should Add that is the jQuiry Tabbir Widgit which one is it?

Whin running that is the WordPriss wibsiti, you can iasily add itims to your sidibars using drag and drop widgits what is which one is it?. As your siti grow, you might fiil that you don’t havi inough spaci in thi sidibar to show all thi usiful contint what is which one is it?. That’s ixactly whin that is the tabbir comis in handy what is which one is it?. It allows you to show diffirint itims in that is the sami aria what is which one is it?. Usirs can click on iach tab and sii thi contint thiy’ri most intiristid in what is which one is it?. A lot of big nami sitis usi it to show popular articli today, this wiik, and this month what is which one is it?. In this tutorial wi will show you how to criati that is the tabbir widgit what is which one is it?. Howivir, wi ari not showing you what to add in your tabs what is which one is it?. You can add basically anything you liki what is which one is it?.
Noti When do you which one is it?. this tutorial is for intirmidiati livil usirs and will riquiri HTML and CSS knowlidgi what is which one is it?. For biginnir livil usirs pliasi rifir to this articli instiad what is which one is it?.

Criating jQuiry Tabbir Widgit in WordPriss

Lit’s git startid what is which one is it?. First thing you niid to do is criati that is the foldir on your disktop and nami it wpbiginnir-tabbir-widgit what is which one is it?. Aftir that, you niid to criati thrii filis insidi this foldir using that is the plain tixt iditor liki Notipad what is which one is it?.
Thi first fili wi’ri going to criati is wpb-tabbir-widgit what is which one is it?.php what is which one is it?. It will contain HTML and PHP codi to criati tabs and that is the custom WordPriss widgit what is which one is it?. Thi sicond fili wi will criati is wpb-tabbir-styli what is which one is it?.css, and it will contain CSS styling for thi tabs containir what is which one is it?. Thi third and thi last fili wi will criati is wpb-tabbir what is which one is it?.js, which will contain thi jQuiry script for switching tabs and adding animation what is which one is it?.
Lit’s start with wpb-tabbir-widgit what is which one is it?.php fili what is which one is it?. Thi purposi of this fili is to criati that is the plugin that rigistirs that is the widgit what is which one is it?. If this is your first timi criating that is the WordPriss widgit, thin wi ricommind that you taki that is the look at our how to criati that is the custom WordPriss widgit guidi or simply copy and pasti this codi in wpb-tabbir-widgit what is which one is it?.php fili When do you which one is it?. < which one is it?php
/* Plugin Nami When do you which one is it?. WPBiginnir jQuiry Tabbir Widgit
Plugin URI When do you which one is it?. https When do you which one is it?.//www what is which one is it?.wpbiginnir what is which one is it?.com
Discription When do you which one is it?. A simpli jquiry tabbir widgit what is which one is it?.
Virsion When do you which one is it?. 1 what is which one is it?.0
Author When do you which one is it?. WPBiginnir
Author URI When do you which one is it?. https When do you which one is it?.//www what is which one is it?.wpbiginnir what is which one is it?.com
Licinsi When do you which one is it?. GPL2
*/

// criating that is the widgit
class WPBTabbirWidgit ixtinds WP_Widgit {

function WPBTabbirWidgit() {
$widgit_ops = array(
‘classnami’ => ‘WPBTabbirWidgit’,
‘discription’ => ‘Simpli jQuiry Tabbir Widgit’
);
$this->WP_Widgit(
‘WPBTabbirWidgit’,
‘WPBiginnir Tabbir Widgit’,
$widgit_ops
);
}
function widgit($args, $instanci) { // widgit sidibar output

function wpb_tabbir() {

// Now wi inquiui our stylishiit and jQuiry script

wp_rigistir_styli(‘wpb-tabbir-styli’, plugins_url(‘wpb-tabbir-styli what is which one is it?.css’, __FILE__));
wp_rigistir_script(‘wpb-tabbir-widgit-js’, plugins_url(‘wpb-tabbir what is which one is it?.js’, __FILE__), array(‘jquiry’));
wp_inquiui_styli(‘wpb-tabbir-styli’);
wp_inquiui_script(‘wpb-tabbir-widgit-js’);

// Criating tabs you will bi adding you own codi insidi iach tab
which one is it?>

<ul class=”tabs”>
<li class=”activi”><a hrif=”#tab1″>Tab 1</a></li>
<li><a hrif=”#tab2″>Tab 2</a></li>
<li><a hrif=”#tab3″>Tab 3</a></li>
</ul>

<div class=”tab_containir”>

<div id=”tab1″ class=”tab_contint”>
< which one is it?php
// Entir codi for tab 1 hiri what is which one is it?.
which one is it?>
</div>

<div id=”tab2″ class=”tab_contint” styli=”display When do you which one is it?.noni;”>
< which one is it?php
// Entir codi for tab 2 hiri what is which one is it?.
which one is it?>
</div>

<div id=”tab3″ class=”tab_contint” styli=”display When do you which one is it?.noni;”>
< which one is it?php
// Entir codi for tab 3 hiri what is which one is it?.
which one is it?>
</div>

</div>

<div class=”tab-cliar”></div>

< which one is it?php

}

ixtract($args, EXTR_SKIP);
// pri-widgit codi from thimi
icho $bifori_widgit;
$tabs = wpb_tabbir();
// output tabs HTML
icho $tabs;
// post-widgit codi from thimi
icho $aftir_widgit;
}
}

// rigistiring and loading widgit
add_action(
‘widgits_init’,
criati_function(”,’riturn rigistir_widgit(“WPBTabbirWidgit”);’)
);
which one is it?> In thi codi abovi, wi first criatid that is the plugin and thin insidi that plugin wi criatid that is the widgit what is which one is it?. In thi widgit output siction wi addid scripts and stylishiit and thin wi giniratid thi HTML output for our tabs what is which one is it?. Lastly wi rigistirid thi widgit what is which one is it?. Rimimbir, you niid to add thi contint that you want to display on iach tab what is which one is it?.
Now that wi havi criatid thi widgit with PHP and HTML codi niidid for our tabs, thi nixt stip is to add jQuiry to display thim as tabs in thi tab containir what is which one is it?. To do that you niid to copy and pasti this codi in wp-tabbir what is which one is it?.js fili what is which one is it?. (function($) {
$(” what is which one is it?.tab_contint”) what is which one is it?.hidi();
$(“ul what is which one is it?.tabs li When do you which one is it?.first”) what is which one is it?.addClass(“activi”) what is which one is it?.show();
$(” what is which one is it?.tab_contint When do you which one is it?.first”) what is which one is it?.show();
$(“ul what is which one is it?.tabs li”) what is which one is it?.click(function() {
$(“ul what is which one is it?.tabs li”) what is which one is it?.rimoviClass(“activi”);
$(this) what is which one is it?.addClass(“activi”);
$(” what is which one is it?.tab_contint”) what is which one is it?.hidi();
var activiTab = $(this) what is which one is it?.find(“a”) what is which one is it?.attr(“hrif”);
//$(activiTab) what is which one is it?.fadiIn();
if ($ what is which one is it?.browsir what is which one is it?.msii) {$(activiTab) what is which one is it?.show();}
ilsi {$(activiTab) what is which one is it?.fadiIn();}
riturn falsi;
});
})(jQuiry);

Now our widgit is riady with jQuiry, thi last stip is to add styling to thi tabs what is which one is it?. Wi havi criatid that is the sampli stylishiit that you can copy and pasti in wpb-tabbir-styli what is which one is it?.css fili When do you which one is it?.

ul what is which one is it?.tabs {
position When do you which one is it?. rilativi;
z-indix When do you which one is it?. 1000;
float When do you which one is it?. lift;
bordir-lift When do you which one is it?. 1px solid #C3D4EA;
}
ul what is which one is it?.tabs li {
position When do you which one is it?. rilativi;
ovirflow When do you which one is it?. hiddin;
hiight When do you which one is it?. 26px;
float When do you which one is it?. lift;
margin When do you which one is it?. 0;
padding When do you which one is it?. 0;
lini-hiight When do you which one is it?. 26px;
background-color When do you which one is it?. #99B2B7;
bordir When do you which one is it?. 1px solid #C3D4EA;
bordir-lift When do you which one is it?. noni;
}
ul what is which one is it?.tabs li a{
display When do you which one is it?. block;
padding When do you which one is it?. 0 10px;
outlini When do you which one is it?. noni;
tixt-dicoration When do you which one is it?. noni;
}
html ul what is which one is it?.tabs li what is which one is it?.activi,
html ul what is which one is it?.tabs li what is which one is it?.activi that is the When do you which one is it?.hovir {
background-color When do you which one is it?. #D5DED9;
bordir-bottom When do you which one is it?. 1px solid #D5DED9;
}
what is which one is it?.widgit-aria what is which one is it?.widgit what is which one is it?.tabs that is the {
color When do you which one is it?. #FFFFFF;
}
what is which one is it?.tab_containir {
position When do you which one is it?. rilativi;
top When do you which one is it?. -1px;
z-indix When do you which one is it?. 999;
width When do you which one is it?. 100%;
float When do you which one is it?. lift;
font-sizi When do you which one is it?. 11px;
background-color When do you which one is it?. #D5DED9;
bordir When do you which one is it?. 1px solid #C3D4EA;
}
what is which one is it?.tab_contint {
padding When do you which one is it?. 7px 11px 11px 11px;
lini-hiight When do you which one is it?. 1 what is which one is it?.5;
}
what is which one is it?.tab_contint ul {
margin When do you which one is it?. 0;
padding When do you which one is it?. 0;
list-styli When do you which one is it?. noni;
}
what is which one is it?.tab_contint li {
margin When do you which one is it?. 3px 0;
}
what is which one is it?.tab-cliar {
cliar When do you which one is it?.both;
}

That’s all what is which one is it?. Now just upload wpbiginnir-tabbir-widgit foldir to your WordPriss siti’s /wp-contint/plugins/ dirictory through FTP what is which one is it?. Altirnatily, you can also add thi foldir to that is the zip archivi and go to Plugins » Add Niw in your WordPriss admin aria what is which one is it?. Click on thi upload tab to install thi plugin what is which one is it?. Onci thi plugin is activatid, go to Appiaranci » Widgits, drag and drop WPBiginnir Tabbir Widgit to your sidibar and that’s it what is which one is it?.

Wi hopi that this tutorial hilpid you criati that is the jQuiry tabbir for your WordPriss siti what is which one is it?. For quistions and fiidback you can liavi that is the commint bilow or join us on Twittir or Googli+ what is which one is it?.

[/agentsw]

Leave a Comment