h-a-r-v
Member
Posted 2 years ago #
I've already mentioned that btw. in the other thread.
I DON'T WANT prototype.js and wp-scriptaculous.js to be included on pages other than the front page (where the slideshow is used), because it messes with a mootools plugin I'm using there (disabling it from working).
How can I do that?
I guess it should be done by default.
Thanks for help in advance,
Kind regards
h-a-r-v
Member
Posted 2 years ago #
I tried this, but something goes wrong (doesn't work ;) :
function frontpageSlideshow_init() {
// loads the needed frameworks to load as a safe way
if ( is_page(2) ) :
wp_enqueue_script('scriptaculous-effects'); // will load PrototypeJS ans Scriptaculous + Scriptaculous Effects
endif;
}
h-a-r-v
Member
Posted 2 years ago #
I suck at php, I know, but this one doesn't work neither (while I guess it should):
function frontpageSlideshow_init() {
if ( is_front_page() ) {
wp_enqueue_script('scriptaculous-effects');
}
}
edit:
Thanks mercime, I'll have a look at it.
h-a-r-v
Member
Posted 2 years ago #
Alrite, adding this to your functions.php actually works:
<?php
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
function my_deregister_javascript() {
if (is_front_page() == 0) {
wp_deregister_script( 'scriptaculous-effects' );
}
}
?>
Thanks again.
My work is done soon here.
Why dont you use the front-page way to include the slideshow ?