Virtue Toolkit Shortcodes

Below, you’ll find a detailed guide on how to add the Virtue/Ascend/Pinnacle Toolkit Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Virtue/Ascend/Pinnacle Toolkit Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Virtue/Ascend/Pinnacle Toolkit Plugin and the shortcodes it provides:

Plugin Icon
Virtue/Ascend/Pinnacle Toolkit

"Virtue/Ascend/Pinnacle Toolkit is a comprehensive plugin designed to enhance your WordPress experience. It simplifies customization, optimizes your site performance, and empowers your website's functionality."

★★★✩✩ (10) Active Installs: 50000+ Tested with: 6.1.4 PHP Version: false
Included Shortcodes:
  • [accordion]
  • [pane]
  • [tabs]
  • [tab]
  • [columns]
  • [hcolumns]
  • [span11]
  • [span10]
  • [span9]
  • [span8]
  • [span7]
  • [span6]
  • [span5]
  • [span4]
  • [span3]
  • [span2]
  • [span1]
  • [columnhelper]
  • [icon]
  • [pullquote]
  • [blockquote]
  • [btn]
  • [hr]
  • [space_20]
  • [space_40]
  • [space_80]
  • [kad_youtube]
  • [kad_vimeo]
  • [clear]

Shortcode

The Virtue Toolkit gallery shortcode allows you to create a dynamic image gallery in WordPress. It retrieves images based on the IDs provided, displaying them in a customizable format. The shortcode supports various parameters such as order, size, columns, and link. It also allows for a lightbox effect, where the images open in a pop-up window. The PHP function ‘kt_toolkit_shortcode_gallery’ handles the shortcode, fetching images, applying filters, and generating the gallery layout. In essence, this shortcode provides a flexible solution for adding a visually appealing image gallery to your WordPress site.

Shortcode:

Parameters

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

  • order – Defines the sequence of the images, ‘ASC’ for ascending, ‘DESC’ for descending.
  • orderby – Sets the parameter to sort the images by, like ‘menu_order ID’.
  • id – Specifies the unique identifier of the gallery.
  • columns – Determines the number of columns in the gallery.
  • link – Determines where the image links to, ‘file’ by default.
  • size – Defines the size of the images, ‘full’ by default.
  • include – Specifies the IDs of the images to be included.
  • use_image_alt – If ‘true’, uses the image alt text. If ‘false’, uses the image caption.
  • gallery_id – Assigns a random number between 10 and 100 as the gallery ID.
  • lightboxsize – Sets the size of the image when viewed in lightbox, ‘full’ by default.
  • exclude – Specifies the IDs of the images to be excluded from the gallery.

Examples and Usage

Basic example – Display a gallery with default settings

Advanced examples

Display a gallery with specific images by referencing their IDs, and ordering the images by the order in which the IDs are listed.

Display a gallery with images excluding certain image IDs, and ordering the images in descending order by the date they were uploaded.

Display a gallery with a specific number of columns, and linking the images to their attachment page instead of their direct file URL.

Display a gallery with images in a specific size, and using the image’s caption as the alt text instead of the image’s alt text.

Display a gallery with a random order of images.

PHP Function Code

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

Shortcode line:

add_shortcode('gallery', 'kt_toolkit_shortcode_gallery');

Shortcode PHP function:

function kt_toolkit_shortcode_gallery($attr) {
	$post = get_post();
	static $instance = 0;
	$instance++;

	if (!empty($attr['ids'])) {
		if (empty($attr['orderby'])) {
		  	$attr['orderby'] = 'post__in';
		}
		$attr['include'] = $attr['ids'];
	}

	$output = apply_filters('post_gallery', '', $attr);

	if ($output != '') {
		return $output;
	}

	if (isset($attr['orderby'])) {
		$attr['orderby'] = sanitize_sql_orderby($attr['orderby']);
		if (!$attr['orderby']) {
	  		unset($attr['orderby']);
		}
	}
	if(!isset($post)) {
    	$post_id = null;
  	} else {
    	$post_id = $post->ID;
  	}

  	extract(shortcode_atts(array(
	    'order'      		=> 'ASC',
	    'orderby'    		=> 'menu_order ID',
	    'id'         		=> $post_id,
	    'columns'    		=> 3,
	    'link'      		=> 'file',
	    'size'       		=> 'full',
	    'include'    		=> '',
	    'use_image_alt' 	=> 'true',
	    'gallery_id'  		=> (rand(10,100)),
	    'lightboxsize'	 	=> 'full',
	    'exclude'    		=> ''
  	), $attr));

  	$id = intval($id);

  	if ($order === 'RAND') {
    	$orderby = 'none';
  	}
  	$caption = 'false';
  	if (!empty($include)) {
    	$_attachments = get_posts(array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
	    $attachments = array();
	    foreach ($_attachments as $key => $val) {
	      	$attachments[$val->ID] = $_attachments[$key];
	    }
  	} elseif (!empty($exclude)) {
    	$attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
  	} else {
    	$attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
  	}
  	if (empty($attachments)) {
    	return '';
  	}
  	if (is_feed()) {
    	$output = "\n";
    	foreach ($attachments as $att_id => $attachment) {
      		$output .= wp_get_attachment_link($att_id, $size, true) . "\n";
    	}
    	return $output;
  	}
  	$output .= '<div id="kad-wp-gallery'.esc_attr($gallery_id).'" class="kad-wp-gallery kt-gallery-column-'.esc_attr($columns).' kad-light-gallery clearfix row-margin-small">';
    if ($columns == '1') {
    	$itemsize = 'col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12 col-ss-12'; 
    	$imgsize = 1140;
    } else if ($columns == '2') {
    	$itemsize = 'col-xxl-3 col-xl-4 col-lg-6 col-md-6 col-sm-6 col-xs-12 col-ss-12'; 
    	$imgsize = 600;
    } else if ($columns == '3'){
    	$itemsize = 'col-xxl-25 col-xl-3 col-lg-4 col-md-4 col-sm-4 col-xs-6 col-ss-12'; 
    	$imgsize = 400;
    } else if ($columns == '4'){ 
    	$itemsize = 'col-xxl-2 col-xl-25 col-lg-3 col-md-3 col-sm-4 col-xs-6 col-ss-12'; 
    	$imgsize = 300;
    } else if ($columns == '5'){ 
    	$itemsize = 'col-xxl-2 col-xl-2 col-lg-25 col-md-25 col-sm-3 col-xs-4 col-ss-6'; 
    	$imgsize = 240;
    } else if ($columns == '6'){ 
    	$itemsize = 'col-xxl-15 col-xl-2 col-lg-2 col-md-2 col-sm-3 col-xs-4 col-ss-6'; 
    	$imgsize = 240;
    } else { 
    	$itemsize = 'col-xxl-1 col-xl-15 col-lg-2 col-md-2 col-sm-3 col-xs-4 col-ss-4'; 
    	$imgsize = 240;
    }
      
  	$i = 0;
  	foreach ($attachments as $id => $attachment) {
    	// Get alt or caption for alt
	    if($use_image_alt == 'true') {
	      	$alt = get_post_meta($id, '_wp_attachment_image_alt', true);
	    } else {
	      	$alt = $attachment->post_excerpt;
	    }

	    $img = kadence_toolkit_get_image_array($imgsize, $imgsize, true, 'kt-gallery-img', $alt, $id);
	    $attachment_url = $img['full'];

	    if($lightboxsize != 'full') {
	            $attachment_lb = wp_get_attachment_image_src( $id, $lightboxsize);
	      		$attachment_url = $attachment_lb[0];
	    }
	    $lightbox_data = 'data-rel="lightbox"';
	    if($link == 'attachment_page') {
	      	$attachment_url = get_permalink($id);
	      	$lightbox_data = '';
	    }

	    $paddingbtn = ($img['height']/$img['width']) * 100;
    	$output .= '<div class="'.esc_attr($itemsize).' g_item"><div class="grid_item gallery_item">';
	      	if($link != 'none') { 
	        	$output .='<a href="'.esc_url($attachment_url).'" '.$lightbox_data.' class="gallery-link">';
	      	}
    		$output .= '<div class="kt-intrinsic" style="padding-bottom:'.esc_attr($paddingbtn).'%;" itemprop="image" itemscope itemtype="http://schema.org/ImageObject">';
    			$output .= '<img src="'.esc_url($img['src']).'" width="'.esc_attr($img['width']).'" height="'.esc_attr($img['height']).'" alt="'.esc_attr($img['alt']).'" '.$img['srcset'].' class="'.$img['class'].'" itemprop="contentUrl" />';
    			$output .= '<meta itemprop="url" content="'.esc_url($img['src']).'">';
                $output .= '<meta itemprop="width" content="'.esc_attr($img['width']).'">';
                $output .= '<meta itemprop="height" content="'.esc_attr($img['height']).'>">';
    		$output .= '</div>';
      		if (trim($attachment->post_excerpt) && $caption == 'true') {
      			$output .= '<div class="photo-caption-bg"></div>';
        		$output .= '<div class="caption kad_caption">';
        			$output .= '<div class="kad_caption_inner">' . wptexturize($attachment->post_excerpt) . '</div>';
        		$output .= '</div>';
      		}
	      	if($link != 'none') { 
	        	$output .= '</a>';
	      	}
    	$output .= '</div></div>';
  }
  $output .= '</div>';
  
  return $output;
}

Code file location:

virtue-toolkit/virtue-toolkit/gallery.php

[accordion] Shortcode

The Virtue Toolkit Accordion shortcode creates a collapsible accordion element on your WordPress site. This shortcode generates a unique ID for each accordion, allowing multiple instances on one page. It uses the ‘do_shortcode’ function to parse nested shortcodes within the accordion content. The ‘even’ and ‘odd’ classes are assigned alternately to style the accordion panels differently. The ‘panel-group’ class creates the accordion effect. In essence, it enhances website interactivity by neatly organizing content.

Shortcode: [accordion]

Parameters

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

  • id – A random number that uniquely identifies each accordion

Examples and Usage

Basic example – A simple usage of the accordion shortcode with the ID parameter. This will generate an accordion with a random ID between 1 and 999.

[accordion id=123 /]

Advanced examples

Creating an accordion with custom content. In this example, the accordion will have two sections with their respective titles and content. The ID is set to 456.

[accordion id=456]
[pane title="First Pane"]This is the content of the first pane.[/pane]
[pane title="Second Pane"]This is the content of the second pane.[/pane]
[/accordion]

Creating a nested accordion. In this example, an accordion with ID 789 contains another accordion with ID 321. Each accordion has its own panes with titles and content.

[accordion id=789]
[pane title="Outer Pane"]This is the content of the outer pane.
    [accordion id=321]
    [pane title="Inner Pane"]This is the content of the inner pane.[/pane]
    [/accordion]
[/pane]
[/accordion]

PHP Function Code

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

Shortcode line:

add_shortcode('accordion', 'virtue_toolkit_accordion_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_accordion_shortcode_function($atts, $content ) {
	extract(shortcode_atts(array(
	'id' => rand(1, 999)
), $atts));
	global $kt_pane_count, $kt_panes;
	$kt_pane_count = 0;
	$kt_panes = array();
	$return = '';
	do_shortcode( $content );
	if( is_array( $kt_panes ) && !empty($kt_panes)){
		$i = 0;
		foreach( $kt_panes as $tab ){
			if ($i % 2 == 0) {
				$eo = "even";
			} else {
				$eo = "odd";
			}
			$tabs[] = '<div class="panel panel-default panel-'.esc_attr($eo).'"><div class="panel-heading"><a class="accordion-toggle '.esc_attr($tab['open']).'" data-toggle="collapse" data-parent="#accordionname'.esc_attr($id).'" href="#collapse'.esc_attr($id.$tab['link']).'"><h5><i class="icon-minus kt-icon-minus primary-color"></i><i class="icon-plus kt-icon-plus"></i>'.wp_kses_post($tab['title']).'</h5></a></div><div id="collapse'.esc_attr($id.$tab['link']).'" class="panel-collapse collapse '.esc_attr($tab['in']).'"><div class="panel-body postclass">'.do_shortcode($tab['content']).'</div></div></div>';
			$i++;
		}
		$return = "\n".'<div class="panel-group kt-accordion" id="accordionname'.esc_attr($id).'">'.implode( "\n", $tabs ).'</div>'."\n";
	}
return $return;
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[pane] Shortcode

The Virtue Toolkit shortcode ‘pane’ creates an accordion-style content pane. It uses the ‘title’ attribute to set the pane’s title and ‘start’ to control its initial state. This shortcode enables dynamic content presentation, enhancing user engagement and site aesthetics. It’s versatile, easy to use, and a great tool for organizing content.

Shortcode: [pane]

Parameters

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

  • title – Defines the title of the accordion pane
  • start – Determines whether the pane is open or closed initially

Examples and Usage

Basic example – Displays a pane with a default title and content.

[pane]

Advanced examples

Displays a pane with a custom title and content. The ‘title’ attribute allows you to specify a custom title for the pane, and the content between the opening and closing shortcode tags is used as the pane’s content.

[pane title="Custom Title"]This is some custom content[/pane]

Displays a pane that starts in a ‘closed’ state. By default, panes are ‘open’, but you can use the ‘start’ attribute to specify that a pane should start ‘closed’.

[pane start="closed"]This is some content in a closed pane[/pane]

Combines both the ‘title’ and ‘start’ attributes to display a pane with a custom title that starts in a ‘closed’ state.

[pane title="Custom Title" start="closed"]This is some custom content in a closed pane[/pane]

PHP Function Code

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

Shortcode line:

add_shortcode('pane', 'virtue_toolkit_accordion_pane_function');

Shortcode PHP function:

function virtue_toolkit_accordion_pane_function($atts, $content ) {
	extract(shortcode_atts(array(
		'title' => 'Pane %d',
		'start' => ''
	), $atts));
	if (!empty($start) || $start == 'closed') {
		$open = '';
	} else {
		$open = 'collapsed';
	}
	if (!empty($start) || $start == 'closed') {
		$in = 'in';
	} else {
		$in = '';
	}
	global $kt_pane_count, $kt_panes;
	$x = $kt_pane_count;
	$kt_panes[$x] = array( 'title' => $title, 'open' => $open, 'in' => $in, 'link' => $kt_pane_count, 'content' =>  $content );

	$kt_pane_count++;
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[tabs] Shortcode

The Virtue Toolkit shortcode ‘tabs’ creates a tabbed content section on a WordPress site. It generates a unique ID for each tab and allows the user to customize the style. This function extracts the attributes, sets global variables, and then checks if the tabs array is not empty. It loops through the array, creating navigation and tab content for each item. The final output is a string of HTML that forms a complete tabbed section. Shortcode: [virtue_toolkit_tab_shortcode_function]

Shortcode: [tabs]

Parameters

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

  • id – A unique number to identify each tab, generated randomly if not provided.
  • style – Defines the visual style of the tabs, defaults to ‘1’ if not specified.

Examples and Usage

Basic Example – The following example demonstrates how to use the shortcode to create a simple tab with a unique ID and default style.

[tabs id="123" /]

Advanced Examples

In the following example, we’re using the shortcode to create a tab with a unique ID and a specific style. The style is set to ‘2’, which will apply the corresponding style from the Virtue Toolkit plugin.

[tabs id="123" style="2" /]

Another advanced example involves creating multiple tabs with different IDs and styles. This allows for greater customization and flexibility when designing your page.

[tabs id="123" style="2" /]
[tabs id="456" style="3" /]
[tabs id="789" style="1" /]

Remember, the ‘id’ attribute must be unique for each tab to function correctly, and the ‘style’ attribute corresponds to the different styles available in the Virtue Toolkit plugin.

PHP Function Code

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

Shortcode line:

add_shortcode('tabs', 'virtue_toolkit_tab_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_tab_shortcode_function($atts, $content ) {
	extract(shortcode_atts(array(
		'id' => rand(1, 9999),
		'style' => '1',
	), $atts));
	global $kt_tab_count, $kt_tabs;
	$kt_tab_count = 0;
	$kt_tabs = array();
	$return = '';
	do_shortcode( $content );
	if( is_array( $kt_tabs ) && !empty($kt_tabs)) {
		foreach( $kt_tabs as $nav ){
			$tabnav[] = '<li class="'.esc_attr($nav['active']).'"><a href="#sctab'.esc_attr($id.$nav['link']).'">'.wp_kses_post($nav['title']).'</a></li>';
		}
		foreach( $kt_tabs as $tab ){
			$tabs[] = '<div class="tab-pane clearfix '.esc_attr($tab['active']).'" id="sctab'.esc_attr($id.$tab['link']).'">'.do_shortcode( $tab['content']).'</div>';
		}
	
		$return = "\n".'<ul class="nav nav-tabs sc_tabs kt-tabs kt-sc-tabs kt-tabs-style'.esc_attr($style).'">'.implode( "\n", $tabnav ).'</ul> <div class="tab-content kt-tab-content postclass">'.implode( "\n", $tabs ).'</div>'."\n";
	}
	return $return;
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[tab] Shortcode

The Virtue Toolkit ‘tab’ shortcode is a dynamic tool that creates tabbed content. It extracts attributes like ‘title’ and ‘start’, and checks if ‘start’ is not empty. If so, the tab is set as ‘active’. The shortcode also maintains a global count of tabs, storing each tab’s details including title, active status, link, and content.

Shortcode: [tab]

Parameters

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

  • title – defines the label of the tab, default is ‘Tab %d’
  • start – if it holds any value, the tab becomes active

Examples and Usage

Basic example – This shortcode allows you to create a tab with a specified title and content. The ‘title’ attribute sets the title of the tab, and the ‘start’ attribute determines whether the tab is active when the page loads.

[tab title="Tab 1" start="active"]Your content here[/tab]

Advanced examples

Creating multiple tabs with different content and different active states. In this example, the first tab will be active when the page loads, but the second tab will not. The content for each tab is enclosed within the shortcode tags.


[tab title="Tab 1" start="active"]Your content for tab 1 here[/tab]
[tab title="Tab 2"]Your content for tab 2 here[/tab]

Using the shortcode to create a tab without specifying the ‘start’ attribute. In this case, the tab will not be active when the page loads.

[tab title="Tab 3"]Your content for tab 3 here[/tab]

PHP Function Code

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

Shortcode line:

add_shortcode('tab', 'virtue_toolkit_tab_pane_function');

Shortcode PHP function:

function virtue_toolkit_tab_pane_function($atts, $content ) {
	extract(shortcode_atts(array(
		'title' => 'Tab %d',
		'start' => ''
	), $atts));
	if (!empty($start)) {
		$active = 'active';
	} else {
		$active = '';
	}
	global $kt_tab_count, $kt_tabs;

	$x = $kt_tab_count;
	$kt_tabs[$x] = array( 'title' => $title, 'active' => $active, 'link' => $kt_tab_count, 'content' => $content );

	$kt_tab_count++;
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[columns] Shortcode

The Virtue-Toolkit plugin shortcode ‘columns’ is used to create a responsive row layout. This shortcode wraps the content within a ‘div’ with class ‘row’, enabling a grid-like structure on your page. It uses the ‘do_shortcode’ function to process any nested shortcodes within the ‘columns’ shortcode.

Shortcode: [columns]

Examples and Usage

Basic example – A simple usage of the ‘columns’ shortcode to create a row with content. The content will be placed within a div element with the class of ‘row’.

[columns]Your content goes here[/columns]

Advanced examples

Example 1: Using the shortcode to create multiple rows with different contents. This will create two div elements with the class of ‘row’, each containing different contents.

[columns]First row content[/columns]
[columns]Second row content[/columns]

Example 2: Using the shortcode to create a row with multiple columns. This can be achieved by nesting ‘columns’ shortcodes inside another ‘columns’ shortcode. Each nested ‘columns’ shortcode will create a new column inside the row.

[columns]
    [columns]Column 1 content[/columns]
    [columns]Column 2 content[/columns]
[/columns]

Please note that these are just examples and the actual output may vary depending on the styles defined in your theme’s CSS for the ‘row’ class.

PHP Function Code

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

Shortcode line:

add_shortcode('columns', 'virtue_toolkit_column_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_column_shortcode_function( $atts, $content ) {
	return '<div class="row">'.do_shortcode($content).'</div>';
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[hcolumns] Shortcode

The Virtue-toolkit plugin’s ‘hcolumns’ shortcode is a tool that creates a horizontal column layout. It wraps the content within a div class, forming a row.

Shortcode: [hcolumns]

Examples and Usage

Basic example – The virtue-toolkit plugin shortcode ‘hcolumns’ is utilized to create a row within your content. It allows you to organize your content into horizontal columns for a more structured and appealing layout.

[hcolumns]Your content goes here...[/hcolumns]

Advanced examples

Using the shortcode with nested shortcodes to create multiple columns within the row. Each ‘hcolumns’ shortcode represents a new column. This example creates a three-column layout.


[hcolumns]
    [hcolumns]Column 1 content...[/hcolumns]
    [hcolumns]Column 2 content...[/hcolumns]
    [hcolumns]Column 3 content...[/hcolumns]
[/hcolumns]

Using the shortcode with HTML tags to style the content within the columns. This example creates a row with two columns, where the first column’s content is bold, and the second column’s content is italicized.


[hcolumns]
    [hcolumns]Column 1 content...[/hcolumns]
    [hcolumns]Column 2 content...[/hcolumns]
[/hcolumns]

PHP Function Code

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

Shortcode line:

add_shortcode('hcolumns', 'virtue_toolkit_hcolumn_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_hcolumn_shortcode_function( $atts, $content ) {
	return '<div class="row">'.do_shortcode($content).'</div>';
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[span11] Shortcode

The Virtue Toolkit shortcode ‘span11’ is designed to create a responsive column that spans 11 out of 12 parts of the page layout. This shortcode wraps the content within a div container, applying the Bootstrap class ‘col-md-11’, which specifies the width of the column.

Shortcode: [span11]

Examples and Usage

Basic example – Virtue toolkit column11 shortcode is used to create a div with a class of “col-md-11”. This class is typically used in Bootstrap to specify the width of a column. Here’s how to use it:

[span11]Your content here[/span11]

Advanced examples

Shortcodes can also be nested within the column11 shortcode to further customize the content. For instance, you can use a shortcode to add a button within the column:

[span11][button]Click me[/button][/span11]

Another advanced usage of the shortcode is to use it in conjunction with other column shortcodes to create a grid layout. Here’s an example of how you can use it to create a two-column layout with one column taking up 11/12 of the width and the other taking up the remaining 1/12:

[span11]Your main content here[/span11][span1]Your sidebar content here[/span1]

PHP Function Code

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

Shortcode line:

add_shortcode('span11', 'virtue_toolkit_column11_function');

Shortcode PHP function:

function virtue_toolkit_column11_function( $atts, $content ) {
	return '<div class="col-md-11">'.do_shortcode($content).'</div>';
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[span10] Shortcode

The Virtue-Toolkit plugin shortcode ‘span10’ is used to create a responsive column that occupies 10 out of 12 parts of the grid layout. This shortcode transforms the content enclosed within its tags into a formatted section. It wraps the content within a div with a class of ‘col-md-10’, making it responsive.

Shortcode: [span10]

Examples and Usage

Basic example – The virtue-toolkit plugin shortcode ‘span10’ can be utilized to create a column that spans 10 out of 12 parts of the grid. This is particularly handy when you want to create a layout that has a wide main content area and a smaller sidebar.

[span10]Your content here...[/span10]

Advanced examples

Embedding another shortcode within the ‘span10’ shortcode. This can be useful for adding elements like sliders, galleries, or forms within the column. Here, we are adding a gallery with the id ‘2’.

[span10][/span10]

Adding multiple shortcodes within the ‘span10’ shortcode. This can be used to add multiple elements within the column. In this example, we are adding a slider with the id ‘3’ and a form with the id ‘4’.

[span10][slider id="3"][form id="4"][/span10]

PHP Function Code

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

Shortcode line:

add_shortcode('span10', 'virtue_toolkit_column10_function');

Shortcode PHP function:

function virtue_toolkit_column10_function( $atts, $content ) {
	return '<div class="col-md-10">'.do_shortcode($content).'</div>';
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[span9] Shortcode

The Virtue-Toolkit plugin shortcode ‘span9’ is used to define a specific column width in your WordPress layout. This shortcode functions to create a column that takes up 9/12, or 75%, of the horizontal space on a page. It wraps the content within a div element with a class of “col-md-9”, which is a Bootstrap class for responsive layouts.

Shortcode: [span9]

Examples and Usage

Basic example – A simple usage of the ‘span9’ shortcode to wrap content within a div with a ‘col-md-9’ class. This will make the content occupy 9 out of 12 columns of a standard Bootstrap grid, which is useful for creating responsive layouts.

[span9]Your content goes here[/span9]

Advanced examples

Using the ‘span9’ shortcode to wrap around another shortcode. This is useful when you want to control the width of another element, such as a contact form, within a responsive layout.

[span9][contact-form-7 id="123" title="Contact form 1"][/span9]

Using the ‘span9’ shortcode to wrap around multiple shortcodes. This is useful when you want to group multiple elements together and control their collective width within a responsive layout.

[span9][contact-form-7 id="123" title="Contact form 1"][/span9]

Please note that in these examples, ‘contact-form-7’ and ‘gallery’ are placeholders for actual shortcodes that you might use in your website. The ‘span9’ shortcode will work with any valid shortcodes that you place within it.

PHP Function Code

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

Shortcode line:

add_shortcode('span9', 'virtue_toolkit_column9_function');

Shortcode PHP function:

function virtue_toolkit_column9_function( $atts, $content ) {
	return '<div class="col-md-9">'.do_shortcode($content).'</div>';
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

Virtue/Ascend/Pinnacle Toolkit [columnhelper] Shortcode

The Virtue-Toolkit plugin shortcode, ‘columnhelper’, is a functional placeholder. It doesn’t return any output when called. Its main purpose is to serve as a structural element in your theme, aiding in the layout design process.

Shortcode: [columnhelper]

Examples and Usage

Basic example – A shortcode that simply calls the ‘columnhelper’ function without any parameters.

[columnhelper /]

PHP Function Code

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

Shortcode line:

add_shortcode('columnhelper', 'virtue_toolkit_columnhelper_function');

Shortcode PHP function:

function virtue_toolkit_columnhelper_function( ) {
	return '';
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[icon] Shortcode

The Virtue-Toolkit Icon shortcode allows users to add custom icons to their WordPress site. It provides flexibility in icon size, color, and float attributes. The shortcode uses four parameters: ‘icon’, ‘size’, ‘color’, and ‘float’. The ‘icon’ parameter defines the icon to be used. ‘Size’ and ‘color’ parameters set the size and color of the icon respectively. The ‘float’ parameter lets the icon float left or right. If ‘float’ is not specified, the icon will not float.

Shortcode: [icon]

Parameters

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

  • icon – sets the specific icon to display
  • size – defines the size of the icon
  • color – specifies the color of the icon
  • float – determines the alignment of the icon

Examples and Usage

Basic example – A simple usage of the ‘icon’ shortcode with the ‘icon’ attribute set to ‘fas fa-user’ which represents a user icon.

[icon icon="fas fa-user" /]

Advanced examples

Using the ‘icon’ shortcode with the ‘size’ attribute to adjust the icon size. The size is set to ’20px’ in this example.

[icon icon="fas fa-user" size="20px" /]

Applying color to the icon using the ‘color’ attribute. Here, the icon color is set to ‘blue’.

[icon icon="fas fa-user" color="blue" /]

Aligning the icon to the left or right using the ‘float’ attribute. In this example, the icon is floated to the right.

[icon icon="fas fa-user" float="right" /]

Combining all the attributes to customize the icon. The icon is set to ‘fas fa-user’, size to ’20px’, color to ‘blue’, and float to ‘right’.

[icon icon="fas fa-user" size="20px" color="blue" float="right" /]

PHP Function Code

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

Shortcode line:

add_shortcode('icon', 'virtue_toolkit_icon_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_icon_shortcode_function( $atts) {
	extract(shortcode_atts(array(
		'icon' => '',
		'size' => '',
		'color' => '',
		'float'=> ''
	), $atts));
	if ($float != '') {
	 	$output = '<i class="'.esc_attr($icon).'" style="font-size:'.esc_attr($size).'; color:'.esc_attr($color).'; float:'.esc_attr($float).'; padding:10px;"></i>';
	} else {
		$output = '<i class="'.esc_attr($icon).'" style="font-size:'.esc_attr($size).'; color:'.esc_attr($color).';"></i>';
	}
	return $output;
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[pullquote] Shortcode

The Virtue Toolkit Pullquote shortcode is designed to align text in your WordPress posts. By using this shortcode, you can center, right-align, or left-align your pullquotes. The code extracts the alignment attribute from the shortcode and applies it to the pullquote. This allows for versatile text presentation, enhancing readability and aesthetic appeal of your content.

Shortcode: [pullquote]

Parameters

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

  • align – determines the alignment of the pullquote on the page

Examples and Usage

Basic Example – The shortcode displays a pull quote on your page. The alignment of the quote is set to “center” by default.

[pullquote]Your Quote Here[/pullquote]

Advanced Examples

1. Using the shortcode to align the pull quote to the right side of the page.

[pullquote align="right"]Your Quote Here[/pullquote]

2. Using the shortcode to align the pull quote to the left side of the page.

[pullquote align="left"]Your Quote Here[/pullquote]

In these examples, the ‘align’ attribute is used to define the alignment of the pull quote. By setting the value to “right” or “left”, you can control where the quote appears on your page.

PHP Function Code

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

Shortcode line:

add_shortcode('pullquote', 'virtue_toolkit_pullquote_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_pullquote_shortcode_function( $atts, $content) {
   extract( shortcode_atts( array(
	  'align' => 'center'
  ), $atts ));

	switch ($align)
	{
		case "center":
		$output = '<div class="pullquote pullquote-center">' . do_shortcode(wp_kses_post($content)) . '</div>';
		break;
		
		case "right":
		$output = '<div class="pullquote pullquote-right">' . do_shortcode(wp_kses_post($content)) . '</div>';
		break;
		
		case "left":
		$output = '<div class="pullquote pullquote-left">' . do_shortcode(wp_kses_post($content)) . '</div>';
		break;
	}

   return $output;
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[blockquote] Shortcode

The Virtue-Toolkit Blockquote shortcode enables the alignment of blockquotes. . This shortcode accepts an ‘align’ attribute, which can be ‘center’, ‘left’, or ‘right’. Depending on the value given, the blockquote will be displayed accordingly.

Shortcode: [blockquote]

Parameters

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

  • align – Determines the alignment of the blockquote: ‘center’, ‘left’, or ‘right’

Examples and Usage

Basic example – Utilizing the ‘blockquote’ shortcode with default alignment.

[blockquote]This is a blockquote[/blockquote]

The above code will generate a blockquote with the default alignment set to ‘center’ as per the virtue_toolkit_blockquote_shortcode_function. The content within the shortcode tags will be displayed in a centered blockquote.

Advanced examples

Using the ‘blockquote’ shortcode with alignment set to ‘left’.

[blockquote align="left"]This is a left-aligned blockquote[/blockquote]

In this example, the blockquote will be aligned to the left of the page. The ‘align’ attribute is set to ‘left’, overriding the default ‘center’ alignment.

Using the ‘blockquote’ shortcode with alignment set to ‘right’.

[blockquote align="right"]This is a right-aligned blockquote[/blockquote]

This example will generate a blockquote that is aligned to the right of the page. The ‘align’ attribute is set to ‘right’, which overrides the default ‘center’ alignment.

PHP Function Code

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

Shortcode line:

add_shortcode('blockquote', 'virtue_toolkit_blockquote_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_blockquote_shortcode_function( $atts, $content) {
	extract(shortcode_atts(array(
		'align' => 'center',
), $atts));
		switch ($align)
	{
		case "center":
		$output = '<div class="blockquote blockquote-full postclass clearfix">' . do_shortcode(wp_kses_post($content)) . '</div>';
		break;
		
		case "left":
		$output = '<div class="blockquote blockquote-left postclass clearfix">' . do_shortcode(wp_kses_post($content)) . '</div>';
		break;
		
		case "right":
		$output = '<div class="blockquote blockquote-right postclass clearfix">' . do_shortcode(wp_kses_post($content)) . '</div>';
		break;
	}
	  return $output;
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[btn] Shortcode

The Virtue-Toolkit plugin shortcode ‘btn’ is designed to create a customizable button on your WordPress site. It allows you to specify various attributes such as the button color, hover color, link, text, and target. The ‘btn’ shortcode also dynamically generates an ID for each button. The output is a stylish button that enhances user interaction on your site. This shortcode is an excellent tool for creating call-to-action buttons.

Shortcode: [btn]

Parameters

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

  • id – Unique identifier given to each button.
  • bcolor – Specifies the background color of the button.
  • bhovercolor – Defines the button’s background color when hovered over.
  • thovercolor – Specifies the text color when the button is hovered over.
  • link – The URL that the button redirects to when clicked.
  • text – The displayed text content on the button.
  • target – Determines where the new linked document will open.
  • tcolor – Defines the text color of the button.

Examples and Usage

Basic example – A simple usage of the shortcode to create a button with a link.

[btn link="http://www.example.com" text="Click Me!"]

Advanced examples

Using the shortcode to create a button with a specific background color and text color. The button will also have a unique ID assigned to it.

[btn id=123 bcolor="#FF0000" tcolor="#FFFFFF" link="http://www.example.com" text="Click Me!"]

Creating a button with hover effects. The button’s background color and text color will change when the mouse is hovered over it.

[btn bcolor="#FF0000" bhovercolor="#0000FF" tcolor="#FFFFFF" thovercolor="#000000" link="http://www.example.com" text="Hover Me!"]

Creating a button that opens a link in a new tab or window. The target attribute is set to “_blank” to achieve this.

[btn target="_blank" link="http://www.example.com" text="Open in New Tab"]

PHP Function Code

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

Shortcode line:

add_shortcode('btn', 'virtue_toolkit_button_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_button_shortcode_function( $atts) {
	extract(shortcode_atts(array(
		'id' => rand(1, 999),
		'bcolor' => '',
		'bhovercolor' => '',
		'thovercolor' => '',
		'link' => '',
		'text' => '',
		'target' => '_self',
		'tcolor' => '',
), $atts));
	$output = '<a href="'.esc_url($link).'" class="btn button btn-shortcode kad-btn kad-btn-primary" id="kadbtn'.esc_attr($id).'" target="'.esc_attr($target).'" style="';
	if(!empty($bcolor)) {
		$output .= 'background-color:'.esc_attr($bcolor).';';
	}
	if(!empty($tcolor)) {
		$output .= 'color:'.esc_attr($tcolor).';';
	}
	$output .= '"';
	if($thovercolor == $tcolor) {$thovercolor = null;}
	if(!empty($bhovercolor) || !empty($thovercolor)) {
		$output .= 'onMouseOver="this.style.background=\''.esc_attr($bhovercolor).'\',this.style.color=\''.esc_attr($thovercolor).'\'" onMouseOut="this.style.background=\''.esc_attr($bcolor).'\', this.style.color=\''.esc_attr($tcolor).'\'"';
	}
	$output .= '>'.wp_kses_post($text).'</a>';

	return $output;
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[hr] Shortcode

The Virtue-Toolkit plugin shortcode ‘hr’ creates a horizontal rule on your webpage. It’s a simple yet effective way to create visual separation in your content. The related PHP code specifies that the ‘hr’ shortcode returns a ‘div’ element with class ‘hrule clearfix’. This creates a horizontal line, adding a neat division in your content.

Shortcode: [hr]

Examples and Usage

Basic example – The virtue-toolkit plugin shortcode ‘hr’ is used to add a horizontal rule in a post or page.

[hr /]

PHP Function Code

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

Shortcode line:

add_shortcode('hr', 'virtue_toolkit_hrule_function');

Shortcode PHP function:

function virtue_toolkit_hrule_function( ) {
	return '<div class="hrule clearfix"></div>';
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[kad_youtube] Shortcode

The Virtue Toolkit ‘kad_youtube’ shortcode embeds a customizable YouTube player in WordPress. The shortcode takes various parameters like URL, width, height, and player controls. It validates the URL and prepares the player according to the parameters. It then returns an iframe with the YouTube player embedded.

Shortcode: [kad_youtube]

Parameters

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

  • url – specifies the URL of the YouTube video
  • width – sets the width of the video player
  • height – sets the height of the video player
  • maxwidth – sets the maximum width of the video player
  • autoplay – if set to ‘true’, the video will start playing automatically
  • controls – if set to ‘true’, the video player controls will be displayed
  • hidecontrols – if set to ‘true’, the video player controls will be hidden
  • fs – if set to ‘true’, the full-screen button will be displayed
  • loop – if set to ‘true’, the video will loop and start over once it ends
  • rel – if set to ‘true’, related videos will be shown at the end
  • vq – sets the video quality, options are ‘hd720’, ‘hd1080’, ‘highres’
  • modestbranding – if set to ‘true’, YouTube logo won’t be displayed on the control bar
  • theme – sets the theme of the video player, options are ‘dark’ and ‘light’

Examples and Usage

Basic example – Display a YouTube video with the default width and height parameters.

[kad_youtube url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" /]

Advanced examples

Display a YouTube video with custom width and height parameters.

[kad_youtube url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" width="800" height="600" /]

Display a YouTube video with custom width and height parameters, autoplay enabled, and controls hidden.

[kad_youtube url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" width="800" height="600" autoplay="true" controls="false" /]

Display a YouTube video with custom width and height parameters, autoplay enabled, controls hidden, and video quality set to high definition.

[kad_youtube url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" width="800" height="600" autoplay="true" controls="false" vq="hd1080" /]

Display a YouTube video with custom width and height parameters, autoplay enabled, controls hidden, video quality set to high definition, and the theme set to light.

[kad_youtube url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" width="800" height="600" autoplay="true" controls="false" vq="hd1080" theme="light" /]

PHP Function Code

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

Shortcode line:

add_shortcode('kad_youtube', 'virtue_toolkit_youtube_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_youtube_shortcode_function( $atts, $content) {
		// Prepare data
		$atts = shortcode_atts(array(
				'url'  => false,
				'width' => 600,
				'height' => 400,
				'maxwidth' => '',
				'autoplay' => 'false',
				'controls' => 'true',
				'hidecontrols' => 'false',
				'fs' => 'true',
				'loop' => 'false',
				'rel' => 'false',
				'vq' => '',
				'modestbranding' => 'false',
				'theme' => 'dark'
		), $atts, 'kad_youtube' );
		$return = array();
		$params = array();

		if ( !$atts['url'] ){
			return '<p class="error">YouTube: ' . __( 'please specify correct url', 'virtue-toolkit' ) . '</p>';
		}
		$id = ( preg_match( '%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $atts['url'], $match ) ) ? $match[1] : false;
		// Check that url is specified
		if ( !$id ) {
			return '<p class="error">YouTube: ' . __( 'please specify correct url', 'virtue-toolkit' ) . '</p>';
		}
		// Prepare params
		if($atts['hidecontrols'] == 'true') {$atts['controls'] = 'false';}
		foreach ( array('autoplay', 'controls', 'fs', 'modestbranding', 'theme', 'rel', 'loop' ) as $param ) $params[$param] = str_replace( array( 'false', 'true', 'alt' ), array( '0', '1', '2' ), $atts[$param] );
		// Prepare player parameters
		if(!empty($atts['vq']) ) {$params['vq'] = $atts['vq']; }
		$params = http_build_query( $params );
		if($atts['maxwidth']) {$maxwidth = 'style="max-width:'.esc_attr($atts['maxwidth']).'px;"';} else{ $maxwidth = '';}
		// Create player
		$return[] = '<div class="kad-youtube-shortcode videofit" '.$maxwidth.' >';
		$return[] = '<iframe width="' . esc_attr($atts['width']) . '" height="' . esc_attr($atts['height']) . '" src="//www.youtube.com/embed/' . esc_attr($id) . '?' . esc_attr($params) . '" frameborder="0" allowfullscreen="true"></iframe>';
		$return[] = '</div>';
		// Return result
		return implode( '', $return );
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[kad_vimeo] Shortcode

The Virtue Toolkit Vimeo shortcode is a powerful tool that embeds Vimeo videos into your WordPress site. The shortcode takes parameters like ‘url’, ‘width’, ‘height’, ‘maxwidth’, and ‘autoplay’. It checks for correct URL input and creates an iframe for a Vimeo video player. The player can be customized with width, height, maxwidth, and autoplay options. The video is displayed within a ‘kad-vimeo-shortcode’ div, allowing for additional CSS styling.

Shortcode: [kad_vimeo]

Parameters

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

  • url – The web address of the Vimeo video to be displayed.
  • width – The width of the video player in pixels, default is 600.
  • height – The height of the video player in pixels, default is 400.
  • maxwidth – The maximum width of the video player in pixels.
  • autoplay – If set to ‘yes’, the video will start playing automatically.

Examples and Usage

Basic example – The following shortcode will display a Vimeo video on your page. The ‘url’ attribute is used to specify the Vimeo video URL.

[kad_vimeo url="https://vimeo.com/123456789" /]

Advanced examples

Display a Vimeo video with specific dimensions. The ‘width’ and ‘height’ attributes are used to set the video’s dimensions.

[kad_vimeo url="https://vimeo.com/123456789" width="800" height="600" /]

Auto-playing the Vimeo video. The ‘autoplay’ attribute is used to auto-play the video as soon as the page loads. Set the ‘autoplay’ attribute to ‘yes’ to enable auto-play.

[kad_vimeo url="https://vimeo.com/123456789" autoplay="yes" /]

Setting a maximum width for the Vimeo video. The ‘maxwidth’ attribute is used to set a maximum width for the video. This is useful when you want to limit the video’s size on larger screens.

[kad_vimeo url="https://vimeo.com/123456789" maxwidth="800" /]

PHP Function Code

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

Shortcode line:

add_shortcode('kad_vimeo', 'virtue_toolkit_vimeo_shortcode_function');

Shortcode PHP function:

function virtue_toolkit_vimeo_shortcode_function( $atts, $content) {
		$atts = shortcode_atts( array(
				'url'        => false,
				'width'      => 600,
				'height'     => 400,
				'maxwidth' 	 => '',
				'autoplay'   => 'no'
			), $atts, 'vimeo' );
		
			if ( !$atts['url'] ){
				return '<p class="error">Vimeo: ' . __( 'please specify correct url', 'virtue-toolkit' ) . '</p>';
			}
			$id = ( preg_match( '~(?:<iframe [^>]*src=")?(?:https?:\/\/(?:[\w]+\.)*vimeo\.com(?:[\/\w]*\/videos?)?\/([0-9]+)[^\s]*)"?(?:[^>]*></iframe>)?(?:<p>.*</p>)?~ix', $atts['url'], $match ) ) ? $match[1] : false;
			// Check that url is specified
			if ( !$id ) {
				return '<p class="error">Vimeo: ' . __( 'please specify correct url', 'virtue-toolkit' ) . '</p>';
			}
			$return = array();
			if($atts['maxwidth']) {
				$maxwidth = 'style="max-width:'.esc_attr($atts['maxwidth']).'px;"';
			} else{ 
				$maxwidth = '';
			}
			$autoplay = ( $atts['autoplay'] === 'yes' ) ? '&amp;autoplay=1' : '';
			// Create player
			$return[] = '<div class="kad-vimeo-shortcode  videofit '.$maxwidth.'">';
			$return[] = '<iframe width="' . esc_attr($atts['width']) . '" height="' . esc_attr($atts['height']) .'" src="//player.vimeo.com/video/' . esc_attr($id) . '?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff' .esc_attr($autoplay) . '" frameborder="0" allowfullscreen="true"></iframe>';
			$return[] = '</div>';

			// Return result
		return implode( '', $return );
	}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

[clear] Shortcode

The Virtue-Toolkit shortcode ‘clear’ is used to add a clearfix to your content. It helps in controlling the layout of floating elements within a block. The PHP function ‘virtue_toolkit_clearfix_function’ returns a div with the class ‘clearfix’. This class clears both left and right floats, effectively resetting the flow of elements.

Shortcode: [clear]

Examples and Usage

Basic example – Utilizes the virtue-toolkit plugin shortcode to create a clear division in your content.

[clear /]

Advanced examples

While the ‘clear’ shortcode doesn’t accept any parameters, it can be used in combination with other shortcodes to structure your content. Here’s an example of using the ‘clear’ shortcode to separate two columns of text:

[column size="one-half" last="false"]Your text here[/column]
[clear /]
[column size="one-half" last="true"]Your text here[/column]

Another advanced usage can be to separate a text block and an image block:

[text_block]Your text here[/text_block]
[clear /]
[image_block id="1" /]

Please note that the ‘column’, ‘text_block’, and ‘image_block’ shortcodes are not part of the virtue-toolkit plugin and their functionality depends on your theme or other plugins you might be using.

PHP Function Code

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

Shortcode line:

add_shortcode('clear', 'virtue_toolkit_clearfix_function');

Shortcode PHP function:

function virtue_toolkit_clearfix_function( ) {
	return '<div class="clearfix"></div>';
}

Code file location:

virtue-toolkit/virtue-toolkit/shortcodes.php

Conclusion

Now that you’ve learned how to embed the Virtue/Ascend/Pinnacle Toolkit Plugin shortcodes, 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 *