Hi there,
Thanks for trying podcast player.
Following steps should help you to stop loading podcast player scripts and styles.
1. Copy and paste following code at the end of your child theme’s functions.php file (If you are not using child theme, you can use Code Snippets plugin to insert custom codes).
add_action( 'after_setup_theme', function() {
if ( is_admin() ) {
return;
}
$id = get_the_ID();
// Return if post ID not available.
if ( ! $id ) {
return;
}
// Replace 6884 with comma separated list of page/post ids ONLY where podcast player is to be displayed.
if ( in_array( $id, array( 6884 ) ) ) {
return;
}
// Remove podcast player scripts.
add_action( 'wp_print_scripts', function() {
wp_dequeue_script( 'podcast-player-mmerrorfix' );
} );
add_action( 'wp_print_styles', function() {
wp_dequeue_style( 'pppublic' );
} );
add_action( 'wp_footer', function() {
if ( class_exists( 'Podcast_player\Frontend' ) ) {
remove_action( 'wp_footer', array( Podcast_player\Frontend::get_instance(), 'enqueue_scripts' ) );
remove_action( 'wp_footer', array( Podcast_player\Frontend::get_instance(), 'svg_icons' ), 9999 );
}
}, 0 );
} );
2. Notice number 6884 in above code. It is page ID of your page where you are using podcast player. If you ever change the page/post or display podcast player on more than one page, just replace or add page ID to above code.
NOTE: Always backup your site before making PHP changes.
Please inform if you need more help on this OR if any other help is required.
If you like the plugin, kindly consider giving five star rating.
Thanks,
-
This reply was modified 4 years, 9 months ago by
Veda.
-
This reply was modified 4 years, 9 months ago by
Veda.