Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   [SOLVED] How to get a header image to rotate every 'N' seconds (http://forum.bytesforall.com/showthread.php?t=1307)

juggledad Jul 6, 2009 06:18 AM

Please swap back to 3.3.3 and wait till after Friday when Flynn gets back. There seems to be a 'glitch' with 3.4

Flynn Jul 10, 2009 09:36 PM

It's also missing in 3.4.1 which fixed many other bugs. On Sunday 7-12-2009 I'll release 3.4.2, or you can edit js.php of 3.4.1 and add this:


PHP Code:

<?php if (strpos($bfa_ata['configure_header'],'%image')!==FALSE AND 
$bfa_ata['header_image_javascript'] != "0" ) { ?>

var HeaderImages = new Array(<?php echo implode(","bfa_rotating_header_images()); ?>);
var t; var j = 0
var p = HeaderImages.length
<?php if ($bfa_ata['header_image_javascript_preload'] == "Yes") { ?>
var PreLoadImages = new Array()
for (i = 0; i < p; i++){
    PreLoadImages[i] = new Image()
    PreLoadImages[i].src = HeaderImages[i]
}
<?php ?>
function RotateHeaderImages(){
    if (document.body){
        HeaderImageContainer = document.getElementById('imagecontainer');
        HeaderImageContainer.style.background = 'url(' + HeaderImages[j] + ') <?php echo $bfa_ata['headerimage_alignment']; ?> no-repeat';
        j = j + 1
        if (j > (p-1)) j=0
        t = setTimeout('RotateHeaderImages()', <?php echo $bfa_ata['header_image_javascript']; ?>000)
    }
}
window.onload = RotateHeaderImages;

<?php ?>

after this

PHP Code:

# if (function_exists('sociable_html')) {
# include (WP_PLUGIN_DIR.'/sociable/wists.js');
# }

?> 


ankita Jul 25, 2009 03:19 AM

URGENT!!!!!!!
dear i have by mistake i have upload the above stated code in theme editor/header.php/rotating image.php
my site got currupted.. i cannot access my site . dat is narinderafurnitures.com
please suggest me the solution to come out of the problem,its damn urgent...

juggledad Jul 25, 2009 04:38 AM

it got dropped in 3.4.0 and 3.4.1 but back in 3.4.2 see xhttp://forum.bytesforall.com/showthread.php?p=9964 if you want to fix one of those two versions - better yet, move to 3.4.2

anisonam Jul 27, 2009 04:19 PM

I am having the same problem. I cannot get the header images to rotate at all, in any browser.

www.tibetanbuddhistaltar.org

I am also using Atahualpa 3.4.1

?

juggledad Jul 27, 2009 05:12 PM

it got dropped in 3.4 (and 3.4.1) but is back in the 3.4.2 version

maccool Jul 30, 2009 06:57 PM

Also does not work using Atahualpa 3.4.2, WP 2.7.1, with Firefox 3.5. I put an extra set of qoutes around the background styling of js.php changing:

function RotateHeaderImages(){
if (document.body){
HeaderImageContainer = document.getElementById('imagecontainer');
HeaderImageContainer.style.background = 'url(' + HeaderImages[j] + ') <?php echo $bfa_ata['headerimage_alignment']; ?> no-repeat';
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('RotateHeaderImages()', <?php echo $bfa_ata['header_image_javascript']; ?>000)
}
}

to this:

function RotateHeaderImages(){
if (document.body){
HeaderImageContainer = document.getElementById('imagecontainer');
HeaderImageContainer.style.background = 'url("' + HeaderImages[j] + '") <?php echo $bfa_ata['headerimage_alignment']; ?> no-repeat';
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('RotateHeaderImages()', <?php echo $bfa_ata['header_image_javascript']; ?>000)
}
}

Now works using IE8, FF 3.5 (Win7 64 bit and Fedora 11), Opera 9.64, and Chrome 2.0.172.39.

arenecute Aug 23, 2009 11:57 AM

I'm using 3.4.1
does that mean i'm not able to have my header image rotated in every 'N' seconds?
so sadddddddddddd >_<

arenecute Aug 23, 2009 12:11 PM

i've just tried this and it WORKS like a charm! thanks you :)))))

Ber|Art Mar 31, 2010 05:04 AM

Will this still work for the newest version you think?

juggledad Mar 31, 2010 05:28 AM

The rotating header image code has been added into the theme. There is an option at ATO->Header Image called 'Rotate header images with Javascript?' that you can change from 0 to rotate the images.

Ber|Art Apr 6, 2010 07:04 AM

Ach, yes offcause, Thx! :)

Ber|Art Apr 15, 2010 01:19 AM

Works fine! thx again! I hope to finish soon so I can show off ;)

ivan91tran Oct 14, 2010 04:45 PM

Thanks a lot juggledad, I had to try a few times, but I finally got it to work. I have to admit it looks great on my site. My only complaint would be that it slows things down about on my site. As soon as I added the javascript, my site also dropped somewhat on the organic Google listing. I think page-load time is a factor. So I decided to switch back. I WILL apply it to my personal blog though, where I don't give a squat about rankings.

Webunet May 4, 2011 02:34 PM

I'm developing a new site, http://www.replaysportsmt.com/

I have 4 images loaded in the /header directory and all appear if the page is refreshed or you go to a new page. They are not rotating however. I have it set to rotate every 4 seconds using JavaScript fade effect.

Can you advise, please?

Thanks,

Tom

lmilesw May 4, 2011 03:26 PM

I currently get a database error when trying to go to your site.

Perhaps you have a plugin conflict? If you turn off fade does it work?

Webunet May 4, 2011 04:12 PM

Quote:

Originally Posted by lmilesw (Post 64702)
I currently get a database error when trying to go to your site.

Perhaps you have a plugin conflict? If you turn off fade does it work?

I removed the "Fade" effect and now it works. Trying it in IE & Firefox, both works, so how do I get the fade to work, its a great transition.

Thanks,

Tom

Webunet May 4, 2011 04:13 PM

Apparently Bluehost had a server issue a few minutes after I sent my message...never fails.

lmilesw May 4, 2011 04:37 PM

So rotation is working now with fade on?

Webunet May 4, 2011 04:45 PM

Working, but WITHOUT fade. Tried fade again, increased time limits for image duration and fade, nothing seems to work with fade.

Thanks

lmilesw May 4, 2011 05:26 PM

You may have a plugin conflict. The fade effect can be problematic and doesn't play nice with some. You can try temporarily deactivation your plugins to see if fade starts working.

p800aul May 21, 2011 02:10 PM

Hi

I can't seem to get the rotating header part of a site I'm testing to work. this is still very much in the suck it and see part of development so only two plugins loaded tried Deactivating them still no joy.

www.tsgmedia.co.uk/tsgwordpress/

Any clues?

Regards

Paul

lmilesw May 21, 2011 04:29 PM

What version of Atahualpa? Do you have all applicable bug fixes installed?

juggledad May 22, 2011 03:44 AM

until you apply the BUGFIX's (see the 'New Versions & Updates' forum) go to ato->Configure CSS & JS and set 'CSS: Compress?' to 'No'

p800aul May 22, 2011 04:01 PM

Yep that fixed it thanks sorry to ask what must have been a dumb question

regards

Paul


All times are GMT -6. The time now is 04:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.