Child Theme and VC Custom Elements

Hello,
i´m following a Tutorial how to create a new element in Visual Composer.
I have to enter

// Before VC Init
add_action( 'vc_before_init', 'vc_before_init_actions' );
 
function vc_before_init_actions() {
 
// Link your VC elements's folder
if( function_exists('vc_set_shortcodes_templates_dir') ){ 
 
       require_once( get_template_directory().'/vc-elements/service-box.php' ); 
 
} 
}
 
}

to functions.php - did it in Child-Theme functions.php. I create vc-elements directory in Childs-root and added service-box.php
But it did not work out.
Admin returns white page.
Can you give me a hint how to add custom vc-code to child-theme function.php?
Thank you

Hi Baumann,

Thanks for reaching out.

I couldn’t really tell what’s wrong based on the code, and looks like it’s not complete implementation. I recommend contacting a developer for this custom development for visual composer’s element. You may check this as well https://www.oodlestechnologies.com/blogs/How-to-create-a-custom-element-in-the-visual-composer

Thanks!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.