the script is only looking for the Id so just putting
<div id="fadeshow1" style="display:none;"> on the page should remove the error.
However it would be a waste to have the script on all pages on the entire website if you only need it on the frontpage. I could see that you were trying out some stuff and you were getting closer. But as I said before it's a little bit tricky in wp. I still feel that the best solution is to put the script only where it is needed( the frontpage ). You dont need to call it in the header.php it should be sufficient to use this
Code:
function js_in_head(){
if(is_front_page()){?>
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/js/fadeslideshow.js">
/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/js/imagearray.js"></script>
<?php }}
add_action('wp_head', 'js_in_head');
In the functions.php
then you would create a new js file called imagearray.js and put this part inside
Code:
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [670, 275], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://www.familyfanclub.net/images/triathlonsectionbanner.png", "http://www.cafepress.com/familyfanclub/4090790", "", ""],
["http://www.familyfanclub.net/images/customsectionbanner.png", "http://www.cafepress.com/familyfanclub/4091103", "", ""],
["http://www.familyfanclub.net/images/TNTsectionbanner.png", "http://www.cafepress.com/familyfanclub/6857140", "", ""],
["http://www.familyfanclub.net/images/runningsectionbanner.png", "http://www.cafepress.com/familyfanclub/4087529", "", ""],
["http://www.familyfanclub.net/images/cyclingsectionbanner.png", "http://www.cafepress.com/familyfanclub/4090807", "", ""],
["http://www.familyfanclub.net/images/swimsectionbanner.png", "http://www.cafepress.com/familyfanclub/4090809", "", ""]//<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})
And save the file in same directory as the fadeslideshow .js
If the conditional function ( js_in_head) is placed in the functions.php it should place both of the needed files in the head section of the front page. you may have to experiment a bit to get the file paths right. The last thing you need is to put the <div id="fadeshow1"></div> the rigth place on the frontpage, but you have that right already. If you succeed in this way of doing it you will avoid slowing down your site by loading the script on all the other pages where it is not needed.
I must admit that it is a bit difficult to explain this. Obviously there are many ways to achieve the result you are after. I'm just trying to explain how I did it.
Bookmarks