Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #24576

    I’ve got the default image background gallery set up. However, I want it NOT to autorotate. Instead, I’d love to get the theme to cycle through each one of those images randomly at every page load. A commenter from the Themeforest page for Flashlight said there wasn’t an option for this, but I was hoping to get guidance on which files I could edit and how to get the behavior I want.

    Thanks

    #123934

    *bump*

    #123935

    Hi yaktails,

    You could try modifying the includes>helper-slideshow.php file or possibly the js>avia_fullscreen_slider.js file. I’m not sure on the specifics because of the way the background slider gets loaded in.

    Regards,

    Devin

    #123936

    I’ve been trying to use array_rand on the various arrays that I see in file includes>helper-slideshow.php but no joy. Any ideas how I can make this work?

    #123937

    Hey,

    open up includes/helper-slideshow.php and replace:

    $attachments = avia_post_meta($this->post_id, 'slideshow');

    with:

    $attachments = avia_post_meta($this->post_id, 'slideshow');
    if(is_array($attachments)) shuffle($attachments);

    Best regards,

    Peter

    #123938

    Doing that throws this error:

    Warning: : shuffle() expects parameter 1 to be array, boolean given in /home/bbuildin/public_html/wp-content/themes/flashlight/includes/helper-slideshow.php on line 152

    #123939

    Hi!

    I changed the code a bit – it should work now.

    Regards,

    Peter

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘How to randomly cycle through image background’ is closed to new replies.