Tabs Responsive Shortcode

Below, you’ll find a detailed guide on how to add the Tabs Responsive Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Tabs Responsive Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Tabs Responsive Plugin and the shortcodes it provides:

Plugin Icon
Tabs Responsive – With WooCommerce Product Tabs Extension

"Tabs Responsive – With WooCommerce Product Tabs Extension is a versatile WordPress plugin that enhances your eCommerce site by adding responsive and customizable product tabs, enriching user experience."

★★★★☆ (489) Active Installs: 20000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [TABS_R]

Tabs Responsive [TABS_R] Shortcode

The TABS_R shortcode is a crucial part of the tabs-responsive plugin. It is used to generate a specific tab’s content on your WordPress site. The TABS_R_ShortCode function is activated when the TABS_R shortcode is used. It checks if an ‘id’ is set for the tab. If not, it leaves the ‘WPSM_Tabs_ID’ variable empty. If an ‘id’ is set, it assigns the ‘id’ to ‘WPSM_Tabs_ID’. It then requires the ‘content.php’ file, which likely contains the layout and style for the tab content. The wp_reset_query() function ensures that global post data is restored to the original main query. The output is then returned and displayed where the shortcode was used.

Shortcode: [TABS_R]

Parameters

Here is a list of all possible TABS_R shortcode parameters and attributes:

  • id – It’s the unique identifier of the tabs section.

Examples and Usage

Basic example – A simple usage of the TABS_R shortcode to display a tabs section with a specific ID.

[TABS_R id=1 /]

Advanced examples

Using the TABS_R shortcode to display a tabs section by referencing both ID and some other parameters. If the ID is not found, it will try to load by the other parameters.

[TABS_R id=1 param1='value1' param2='value2' /]

In this example, ‘param1’ and ‘param2’ are placeholders for actual parameters that your shortcode might accept. Replace them with the actual parameter names and ‘value1’ and ‘value2’ with the values you want to set for those parameters.

Remember, the parameters you can use depend on how the TABS_R_ShortCode function is defined. If it’s not set up to accept other parameters, adding them to the shortcode won’t have any effect.

PHP Function Code

In case you have difficulties debugging what causing issues with [TABS_R] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'TABS_R', 'TABS_R_ShortCode' );

Shortcode PHP function:

function TABS_R_ShortCode( $Id ) {
	ob_start();	
	if(!isset($Id['id'])) 
	 {
		$WPSM_Tabs_ID = "";
	 } 
	else 
	{
		$WPSM_Tabs_ID = $Id['id'];
	}
	require("content.php"); 
	
	
	wp_reset_query();
    return ob_get_clean();
}

Code file location:

tabs-responsive/tabs-responsive/template/shortcode.php

Conclusion

Now that you’ve learned how to embed the Tabs Responsive Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *