Okay
  Public Ticket #3562424
Salient WPBakery element template override
Closed

Comments

  • MILK_is_Good started the conversation

    Hi,

    We are trying override the template for the element vc_custom_heading, if we copy the template file to child-theme/vc_templates, it doesn't override the element output.

    The link below explains how to override the Salient elements templates, but it only overrides templates that are in the salient-core plugin (/plugins/salient-core/includes/vc_templates).

    https://themenectar.com/docs/salient/overriding-salient-wpbakery-element-template-files-through-a-child-theme/

    How can we override the WPBakery elements templates which are located in the js_composer_salient plugin (/plugins/js_composer_salient/include/templates/shortcodes), which is where the vc_custom_heading is located?

    We also tried using the vc_set_shortcodes_templates_dir() from the original WPBakery Docs, https://kb.wpbakery.com/docs/inner-api/vc_set_shortcodes_templates_dir/, but that is also not picking up the template from the child theme.

  •  8,838
    Tahir replied

    Hey MILK_is_Good ,

    Escalating this to the developer for further response.

    Thanks.


    ThemeNectar Support Team 

  •  1,069
    ThemeNectar replied

    Hey MILK_is_Good,

    You can use the following snippet from your child functions.php to handle that override: 

    add_filter('vc_shortcode_set_template_vc_custom_heading', 'salient_child_custom_vc_heading_path');
    function salient_child_custom_vc_heading_path() {
      return get_stylesheet_directory() . '/vc_templates/vc_custom_heading.php';
    }
    

    Kind regards

  • MILK_is_Good replied

    Works perfectly, thank you.