Skip to content

Snippet: Trigger Stretched Rows Inside WPBakery Page Builder Tabs

By default if you add a stretched row in the WPBakery Page Builder (formerly known as Visual Composer) it won't render properly because these rows need to be visible on site load to display properly as they aren't really intended to be added inside a hidden area such as tabs. However, with the code above added to your child theme you can re-trigger the stretched row javascript whenever a tab loads or is clicked so you can have stretched rows inside tabs.

add_action( 'wp_footer', function() { ?>

	
		( function( $ ) {
			function onShow() {
				vc_rowBehaviour();
			}
			$( '.vc_tta-tabs' ).on( 'show.vc.tab', 'onShow' );
			$( document ).on( 'click.vc.tabs.data-api', '[data-vc-tabs]', onShow );
			$( document ).on( 'show.vc.accordion', onShow );
		} ) ( jQuery );
	

<?php } );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top