This topic contains 1 reply, has 2 voices, and was last updated by Phil (Support) 4 years, 2 months ago.
-
Ticket
-
Guys sorry if my question is general and for my lack of knowledge
Appricate if you help me to knowI have the child theme activated but as a matter of fact I am not sure How I can use it
Right now I want to add this code to theme’s functions.php
1function manage_cf7_js_styles_recaptcha() { // Dequeue cf7 and recaptcha scripts and styles, preventing them from loading everywhere wp_dequeue_script( 'contact-form-7' ); wp_dequeue_script( 'google-recaptcha' ); wp_dequeue_style( 'contact-form-7' ); // If current post has cf7 shortcode, enqueue! global $post; if ( isset( $post->post_content ) AND has_shortcode( $post->post_content, 'contact-form-7' ) ) { if ( function_exists( 'wpcf7_do_enqueue_scripts' ) ) { wpcf7_do_enqueue_scripts(); wp_enqueue_script( 'google-recaptcha' ); } } } add_action( 'wp_enqueue_scripts', 'manage_cf7_js_styles_recaptcha', 10, 0 );My question is how to do it? I think I need to create a file called functions.php in child theme and simply this this file
have only the above code?
Does the file need to be in another folder within the child them folder?
Sorry, only verified customers can view ticket replies.