Well this idea (where presumably the fadeslideshow.js script in the other child themes' /js folders or wherever this points to when the child theme with the script is not being used - like if it defaults to the main js folder if there's no child theme - is just a blank file):

Originally Posted by
azoomer
The way I use it in wordpress is in connection with a child theme and the javescript for the slideshow is only inserted on the particular page where it is needed with a conditional statement like this in the functions.php
Code:
function js_in_head(){
if(is_front_page()){?>
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/js/fadeslideshow.js"></script>
<?php }}
add_action('wp_head', 'js_in_head');
And I do the same for the other part of the slideshow script ( the part with the dynamic drive credit)
If that will work or not on your wp installation is depending on your configuration, file structure and the way you edit your template. So more info on that will probably be needed to get this working on your site.
or any other scheme whereby the script doesn't get put on the pages that aren't using it, is best.
But, using a text only editor like NotePad, the script can be edited not to give that alert, here (a little more than halfway down in the bgcarousel.js file, add red comment slashes as shown):
Code:
init:function($, slidesHTML){
var slideshow=this, setting=this.setting
this.$wrapperdiv=$('#'+setting.wrapperid)
setting.dimensions=[this.$wrapperdiv.width(), this.$wrapperdiv.height()]
this.$wrapperdiv.css({position:'relative', visibility:'visible', overflow:'hidden', backgroundImage:'none', width:setting.dimensions[0], height:setting.dimensions[1]}) //main DIV
if (this.$wrapperdiv.length==0){ //if no wrapper DIV found
//alert("Error: DIV with ID \""+setting.wrapperid+"\" not found on page.")
return
}
this.$wrapperdiv.html(slidesHTML)
this.$imageslid . . .
Save and use that version. Since the script is already cached, it won't waste much bandwidth or loading time on the pages where it's not being used.
The browser cache may need to be cleared and/or the page refreshed to see changes.
Bookmarks