Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17705

    You previously helped me randomize the order of the slides, and it works great on the home page, but now that I am building the other pages, I get this on all pages:

    “Warning: shuffle() expects parameter 1 to be array, boolean given in /home/content/73/8802073/html/imt/wp-content/themes/choices/includes/helper-slideshow.php on line 36″

    This is what I added to the helper-slideshow.php:

    $this->slides = avia_post_meta($this->post_id, ‘slideshow’);

    with:

    $this->slides = avia_post_meta($this->post_id, ‘slideshow’);

    shuffle($this->slides);

    #96544

    This only happens if I do not have a slideshow on the page.

    #96545

    Hey zorrolynx,

    I think it just needs an ‘if slideshow than shuffle else nothing’ but I’m not sure about that within the whole function. I’ve tagged another support crew on this who should be able to shed some light on it and correct the code :)

    Regards,

    Devin

    #96546

    Hey!

    Please replace:

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

    with:

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

    Best regards,

    Peter

    #96547

    Perfect!

    Thanks!

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

The topic ‘Randomize Slide order in slider for Choices Theme’ is closed to new replies.