Tabby Responsive Tabs

Wordpress Plugin
Download latest - 1.4.1

Developers

numeeja

Download Stats

Today 62
Yesterday 102
Last Week 613
All Time 183,109
Banner 772x250

  • Adds a set of horizontal tabs which changes to an accordion on narrow viewports
  • Tabs and accordion are created with jQuery
  • Supports multiple sets of tabs on same page
  • Uses semantic header and content markup
  • Aria attributes and roles aid screen reader accessibility
  • Tabs and content are accessible via keyboard

The Tabby responsive tabs plugin is designed to be an easy and lightweight way to add responsive tabs to your content. Experienced developers should be able to easily customize how the tabs display on their site by replacing the built-in CSS rules with an edited version (see note below for more details of this).

Optional Add-ons

The Tabby responsive tabs customiser add-on adds a settings panel with several parameters to provide the easiest way to customise the display of your tabs without editing any code. You can use the default tabby styles or one of the included one-click presets as a starting point for customisation. It also enables you to easily add icons to your tab titles.

The Tabby link to tab add-on provides a simple shortcode to create links to specific tabs which can appear anywhere on the same page as the tabgroup without the page reloading.

The Tabby tab to URL link add-on enables you to set one or more of your tabs to act as a link to any URL.

The Tabby load accordion closed add-on changes the default behaviour when the tabs are displayed as an accordion so that no accordion sections are open when the page initially loads.

The Tabby reopen current tab on reload add-on enables the currently active tab to remain the active (open) tab after the page has been reloaded/refreshed.

Usage:

There are two shortcodes used to create the tab group: [tabby] and [tabbyending] both must be used as below to create a tab group.

To start a new tab use a [tabby] shortcode, eg:

[tabby title="tabname"]

replace tabname with the name of your tab.

Add the tab content after the shortcode.

Add a [tabbyending] shortcode after the content of the last tab in a tabgroup.

Example

If you copy & paste this example into your own page instead of typing them, ensure that you delete any stray <code> or <pre> tags that might have appeared.

`

[tabby title="First Tab"]

This is the content of the first tab.

[tabby title="Second Tab"]

This is the content of the second tab. This is the content of the second tab.

[tabby title="Third Tab"]

This is the content of the third tab. This is the content of the third tab. This is the content of the third tab.

[tabbyending]

`

note: To prevent stray paragraph tags being introduced by WordPress's wpautop filter, ensure that there is a blank line above and below each tabby shortcode and the tabbyending shortcode.

You can see the tabs on the demo page.

You can add the shortcodes to a page made using the WordPress block editor by using WordPress's shortcode block.

If you want to change how the tabs and accordion display on your site, you have two options:

  1. Use the Tabby Responsive Tabs Customiser plugin which provides a very easy way to customise the display of your tabs without needing to edit any code.

  2. Copy the contents of the plugin's stylesheet into your child theme or custom styles plugin and make the changes to that copy as required. If you do this you will also need to prevent the built-in styles from loading by going to the admin page at settings => tabby and unchecking the "Include the default tabby stylesheet" checkbox.

Additional Shortcode attributes

Open

The first (leftmost) tab panel will be open by default in 'tab view' and in 'accordion view'.

If you want a specific tab other than the first tab to be open by default when the page first loads, you can add the parameter & value open="yes" to the shortcode for that tab:

[tabby title="My Tab" open="yes"]

If you use the 'open' shortcode parameter in one of your tab shortcodes, ensure that you only add it to single tab as having more than one tab open within a tab group is not supported.

Icon

The markup required to show an icon alongside a tab title can be added by using the 'icon' attribute. Tabby responsive tabs does not add the icon files, you will also need to use a theme or plugin (such as the tabby responsive tabs customiser add-on) to add the icon files: `

[tabby title="My Tab" icon="cog"]

` This adds a pseudo element before the tab title with the classes "fa" and "fa-cog". Other icon font sets can be used if you ensure the CSS rules target the classes added by the plugin.

The Tabby Responsive Tabs Customiser plugin can be used to add the Font Awesome files required to display the icons in the tab titles.

Class

This allows a custom class to be added to each tab and tab content area. The class added to the tab will be the value of the class parameter and the class of the tab content area associated with that tab will be the class with the '-content' suffix.

Controlling which tab is open when linking to the page

You can use a 'target' URL parameter in your link to set which tab will be open when the page initially loads. The value of this parameter is based on the tab title specified in the tabby shortcode which built the tab, but formatted with punctuation & special characters removed, accents removed, and with dashes replacing the spaces.

If you want to link to a 'contacts' page with a tab titled 'Phone Numbers' open, the url you use to link to this page would look like: ` yoursite.com/contact/?target=phone-numbers

`

If you want a tab with the title 'email addresses' to be open, the url would look like: yoursite.com/contact/?target=email-addresses If you want a tab with the title 'entrées' to be open (with an acute accent over the second e), the url would look like: yoursite.com/contact/?target=entrees Using a target url parameter will override any open shortcode parameters used.


Releases (17 )

Version Release Date Change Log
1.4.1 2022-04-11
  • New setting to specify the font awesome icon style
1.4.0 2022-03-18
  • Added localization and various translations
1.3.5 2022-02-27
1.3.4 2022-02-20
  • tab titles sanitized with wp_kses() to allow line breaks in tab titles
  • Sanitize html for tab title element
1.3.3 2022-02-08
  • Added option to change the tab title element
1.3.0 2022-01-25
  • using target url parameter overrides open shortcode parameter for which tab is to be open on page load
  • Shortcode parameters now used in array, not extracted
  • Priority of tabbytrigger changed to 30 by default to prevent breakage on pages created with the WordPress block editor. Prority can be changed by adding 'priority' shortcode parameter with an appropriate value
  • ico shortcode parameter added to enable custom icons to be added without adding font-awesome prefixes.
  • replaced tabbytrigger function - now uses wp_add_inline_script
1.3.2 2022-01-25
1.3.1 2022-01-25
  • Fixed issue with the option value saving
  • using target url parameter overrides open shortcode parameter for which tab is to be open on page load
  • Shortcode parameters now used in array, not extracted
  • Priority of tabbytrigger can be changed by adding 'priority' shortcode parameter with an appropriate value
  • Priority of tabbytrigger changed to 30 by default to prevent breakage on pages created with gutenberg
  • ico shortcode parameter added to enable custom icons to be added without adding font-awesome prefixes
1.2.3 2017-12-08
  • Enable targeting the tab from url query string when the title contains an accent
1.2.2 2016-01-13
  • Included print stylesheet as a separate file
1.2.1 2015-08-31
  • Added index.php to prevent the content of plugin directories being viewed if the site has not had directory browsing disallowed.
1.2.0 2014-11-26
  • Added basic print styles to default stylesheet
1.1.1 2014-09-14
  • Improvements to default CSS
  • Addition of 'open' shortcode attribute to allow tabs other than the first to be open when the page loads
  • First tab now is open by default when displayed as accordion
  • Changed links in plugin table
  • Get Plugin Version function
  • Prevent tabs overlapping if there are too many
  • Remove hard coded paragraph tags in tab content & improve
  • Added icon font support (Font Awesome needs to be loaded by your theme or another plugin)
  • Added functionality to allow target url parameter to control which tab is open on page load.
1.0.3 2014-04-16
  • improved theme compatibility with default css
1.0.2 2014-03-09
  • enqueue plugin js only when needed
  • css for improved specificity
1.0.1 2013-12-24
  • Updated js & css
1.0.0 2013-11-26
  • Initial Version

=