dequeue script in parent theme
-
I am developing a site using a child theme of twentyninteen. I have it working as it should but I’m trying to clean it up and make it better.
A script in the parent twentynineteen theme is causing problems when the site is viewed on ipad. I have tried to dequeue it but it still seems to be loading. The script is in wp-content/themes/twentynineteen/js and is touch-keyboard-navigation.js
Here is my child theme funtions.php:
<?php //* Code goes here function enqueue_parent_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); } add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' ); //Dequeue JavaScripts function project_dequeue_unnecessary_scripts() { wp_dequeue_script( 'touch-keyboard-navigation' ); } add_action( 'wp_print_scripts', 'project_dequeue_unnecessary_scripts', 100 );
Any help getting this configured correctly to remove script will be much appreciated. Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘dequeue script in parent theme’ is closed to new replies.