1. Home
  2. Docs
  3. Inner API
  4. vc_shortcodes_theme_templates_dir()


This function returns path to the folder where WPBakery Page Builder is looking for content element templates. By default it returns empty string, but if vc_set_shortcodes_templates_dir() was used previously, then custom directory path will be returned.

<?php vc_shortcodes_theme_templates_dir( $template ); ?>


Param name
$template String Content element template file name. For [my_shortcode] shortcode template file is my_shortcode.php. For default “Message box” element, template file name is vc_message.php


Get current custom templates directory path.

$dir = get_stylesheet_directory() . '/vc_new_templates_dir'; // First, set new directory for templates
vc_set_shortcodes_templates_dir( $dir );
// ...
var_dump( vc_shortcodes_theme_templates_dir( 'vc_message.php' ) ); // Outputs full directory path for vc_message.php template


Was this article helpful to you? Yes No