1

In functions.php of my parent theme, I have these

function karuna_scripts() {

wp_enqueue_script( 'karuna-functions', get_template_directory_uri() . 
'/assets/js/functions.js', array( 'jquery' ), '20160531', true );

}

add_action( 'wp_enqueue_scripts', 'karuna_scripts' );

I am trying to Dequeue 'karuna-functions' in a child theme

// BEGIN DEQUEUE PARENT ACTION

function remove_parentstickyfunctions() {
    wp_dequeue_script('karuna-functions');
}

add_action('wp_enqueue_scripts','remove_parentstickyfunctions');

// END DEQUEUE PARENT ACTION

But I am still getting the sticky menu functionality which I believe is loaded from /assets/js/functions.js of the parent theme.

How do I remove the sticky menu functionality in the child theme?

1 Answer 1

1

Try increasing the priority of the respective action, otherwise the system will not know what to dequeue:

function remove_parentstickyfunctions() {
    wp_dequeue_script('karuna-functions');
}
add_action('wp_enqueue_scripts','remove_parentstickyfunctions', 20);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.