Enqueueing Script in child theme not working

I am using Avada Child Theme that comes packed with AVADA Package. I have created a folder named “JS” inside the child theme folder and put a scripts.js in that folder.

Here is the Code that I have added at the last of the functions.php file in child theme folder.

function cool_scripts() {
wp_enqueue_script( ‘cool-stuff’, get_stylesheet_directory_uri() . ‘/js/scripts.js’, array(‘jquery’), ‘1.0.0’, false );

add_action( ‘wp_enqueue_script’, ‘cool_scripts’ );

I also want to use jQuery in it so I used the array.

I also have a backup php file named “function-bkp.php” inside the Child theme folder. (Same folder where function.php exists, tried deleting that)

But I can’t find the script added while I view the source of my wordpress homepage.

What I want to achieve with jQuery is shown in the Code Snippet below

jQuery(“.fusion-secondary-header .fusion-contact-info”).empty();

Main Problem:- Enqueueing doesn’t work neither it creates a script tag at the header or footer

Read more here:: Enqueueing Script in child theme not working

Leave a Reply

Your email address will not be published. Required fields are marked *