fbpx

This solution has an advantage over the traditional method of including shortcode templates in a theme folder. It allows you to override both Visual Composer templates in a theme AND built-in Visual Composer templates, which makes it perfect for use in a plugin.

It’s simple – you just add a filter for “vc_shortcode_set_template_%element_slug%’ like so:

add_filter( 'vc_shortcode_set_template_vc_row', 'vc_cr_update_vc_row_template_dir' );
function vc_cr_update_vc_row_template_dir() {
     return plugin_dir_path(__FILE__)."template/vc_row.php";
}