Calling jQuery from functions.php

I want to call a jQuery from my functions.php in WordPress.

I’m using Divi Theme. When I add the script directly into Divi theme it works. But I want to add it to the functions.php form my child theme and this is where the problem start.

What have I done so far:


function coolbanner_enqueue() {

        wp_enqueue_script( 'custom-scripts', get_stylesheet_directory_uri() . '/js/coolbanner.js', array( 'jquery' ));
    add_action( 'wp_enqueue_scripts', 'coolbanner_enqueue' );


    jQuery('#cta-section').waypoint(function() {
    }, {offset: '80%'});

Can somebody point out what I’m doing wrong?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s