PDA

View Full Version : Ultimate Fade-in slideshow (v2.4)



Woppadon
01-06-2011, 05:17 PM
1) Script Title: Ultimate Fade-in slideshow (v2.4)

2) Script URL (on DD): http://www.dynamicdrive.com/forums/showthread.php?t=55611

3) Describe problem:

I am trying to place images on one particular page on my Wordpress website. I have used the tutorial to show the slideshow by placing the script in the head and it does come up with the error:

error: Div with id "fadeshow1" not found on page

when selecting a different page. I have sourced this forum and found the post stated above that shows you to put the script in the functions.php.

However when I do this IE or firefox does not recognise the site. It shows
the error.

Parse error: syntax error, unexpected '}' in C:\xampplite\htdocs\wordpress\wp-content\themes\Ois_design\functions.php on line 23

Im relatively new to wordpress, php, css, xhtml and javascript. So any help would be greatly appreciated. Is there anything im missing out on. I am using a localhost to develop the site, so I cannot provide a link. I have attached the functions.php code below:

[CODE]
<?php

if ( function_exists('register_sidebar') )

register_sidebar();
?>

function js_in_head(){
if(is_front_page()){?>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/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_uir(); ?>/imagearray.js"></script>

<?php }}
add_action('wp_head', 'js_in_head');
[CODE]

Woppadon
01-06-2011, 06:08 PM
Pardon my typing, I have rectified this

[code]

<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/imagearray.js"></script>

[code]

Woppadon
01-07-2011, 09:58 AM
After changing the typing error and placing the following code in the functions.php:

[code]

<?php

if ( function_exists('register_sidebar') )

register_sidebar();
?>

function js_in_head(){
if(is_front_page()){?>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/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(); ?>/imagearray.js"></script>

<?php }}
add_action('wp_head', 'js_in_head');

[code]

I get the following error:

Parse error: syntax error, unexpected '}' in C:\xampplite\htdocs\wordpress\wp-content\themes\Ois_design\functions.php on line 23

Basically I am trying to get the image slideshow to show on one page (the about us page). I need this to be placed in the body section, and not the head where the previous solution did.

I hope my previous post didnt suggest that I solved the problem. It was just a typo.

jscheuer1
01-07-2011, 11:07 AM
Wait a minute, slow down. Go back to the way you had it when you were getting the alert:


Error: Div with ID "fadeshow1" not found on page.

That was probably fine, it probably just meant that you didn't have that division on every page. If so, just comment out that line in the script (line #50 in my copy, addition red):


. . . button=(setting.descreveal=="always")? '<img class="close" src="'+closebutt[0]+'" style="float:right;cursor:hand;cursor:pointer;width:'+closebutt[1]+'px;height:'+closebutt[2]+'px;margin-left:2px" title="Hide Description" />' : ''
var slideshow=this
jQuery(document).ready(function($){ //fire on DOM ready
var setting=slideshow.setting
var fullhtml=fadeSlideShow.routines.getFullHTML(setting.imagearray) //get full HTML of entire slideshow
setting.$wrapperdiv=$('#'+setting.wrapperid).css({position:'relative', visibility:'visible', background:'black', overflow:'hidden', width:setting.dimensions[0], height:setting.dimensions[1]}).empty() //main slideshow DIV
if (setting.$wrapperdiv.length==0){ //if no wrapper DIV found
//alert("Error: DIV with ID \""+setting.wrapperid+"\" not found on page.")
return
}
setting.$gallerylayers=$('<div class="gal . . .

This has come up before with WordPress and other CMS's. That's always taken care of it. There was one case where the page was invalid and that caused the error even though the fadeshow1 division was on the page, but that wasn't with a CMS.

If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

Woppadon
01-07-2011, 11:25 AM
John

Thank you so much for the swift reply. That sorted it. I hope ye have a good one.

Cheers

Woppadon
01-12-2011, 05:34 PM
Hello, me again..............

I know John kindly help me sort out my error above. However when selecting a sub menu item it shows: "Done, but errors on page". Does this mean that I have to use the following



<div id="fadeshow1" style="display:none;"></div>


on each page as discussed in the post stated at the start of the tread? Or is there a better way to do this?

Is it possible to use this fade in slide show on multiple pages, using different images in each one. I think by creating new names i.e fadeshow2 etc it can, am I right?

I would be very grateful for any information.

I have tried to upload my new blog but I am having trouble to convert it from xampplite, as I hosts it locally.

jscheuer1
01-12-2011, 07:47 PM
There is no sub menu item in this script. If that's what's causing the error, chances are it has nothing to do with this script.

Ultimately if you want to continue using scripts, you are going to have to either learn how to use your CMS with scripts or get someone to do it for you. That's because it's likely you will from time to time be updating things and/or changing things around.

This forum isn't really designed for that purpose.

As for having a different slideshow on different pages, that's one way to go about it. However, you would be better off only having the one call to the show that is needed on any given page that requires it.

The way you are doing things now appears to be to put every script on every page. Unless they are required on every page, this is inefficient at best. There must be a way to put just the scripts you need for a given page on that page.

Some scripts may be required for all. Those should remain in the template/include for all pages. Those that are only required for a given page should go somewhere that is only written to that page.

If you want more help on sorting out this latest error, I would need a link to the page. But without access to the CMS, I will only be able to tell you so much.

Woppadon
01-19-2011, 06:16 PM
Hello,

Sorry for the delay in getting back to upload my site. I have done so, so you can view it at:

http://www.officeinteriorsolutions.com/blog/about-us

You will be able to see what I am doing. I want to be able to have a slide show on nine different pages in wordpress. Each of them will be different in size and of the pictures in them. I know that by placing the script in the header is not efficient and that this has been covered in the post:

http://208.75.149.97/forums/showthread.php?p=230316

however I want the slideshow in the body section on the page not the header. Is there a a way round this. I would be very grateful. On the site, I can get the first slideshow working on the about us page. (excuse some of the images as they havent fully uploaded yet) I have also used the code to create a slideshow on the following page:

http://www.officeinteriorsolutions.com/blog/about-us/what-ois-gives-you


However this doesnt work.

I am at your disposal........

Woppadon
01-27-2011, 05:35 PM
I have changed all the links etc on my uploaded site. I appologize for this, if I seemed shoddy. Can anyone help me with the questions on the previous post. I would really appreciate it. I acknowedge that I will have to learn script. I would rather not use flash to do this.