PenciDesign Supporter replied
Hi,
Following your request, you can modify the script on init.php like below:
add_action( 'wp_enqueue_scripts', function () {
if ( !is_home() || !is_front_page() ){
wp_enqueue_script( 'youtube-api', 'https://www.youtube.com/iframe_api', '', '1.0', true );
wp_enqueue_script( 'penci-play-js', plugin_dir_url( __FILE__ ) . 'assets/play.js', [ 'youtube-api' ], '1.0', true );
}
} );OR you can install the Code Snippet, then create a new snippet with the following content:
add_action( 'wp_enqueue_scripts', function () {
if ( is_home() || is_front_page()) {
wp_dequeue_script( 'youtube-api');
wp_dequeue_script( 'penci-play-js' );
}
} );Regards,
PenciDesign.
