Random Gallery Order

Mauer Themes Support Bild Random Gallery Order

This topic contains 2 replies, has 2 voices, and was last updated by  ollithomson 1 week, 3 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2988

    ollithomson
    Participant

    Hello Paul.

    My front page gallery currently autoruns as a slideshow but I would like to set it up so that the images run in random order. Is it possible to do this?

    Thanks.

    olli

    ollithomsonphotography.com

    #3000

    Paul
    Keymaster

    Hello Olli,

    You can randomize the images in a gallery each time it is loaded by using the following line of code:

    if ($post_id == 430) { shuffle($images); }

    To use it, in your Admin Panel please go to ‘Appearance’ -> ‘Editor’, find the functions.php file on the right, go to the whereabouts of line 545, and insert the above code at the place that you see in this screenshot.

    I’m using 430 there because it is the ID of the gallery post I want the randomization to happen in. You’ll need to use an ID relative to you instead.

    You can see the ID of a gallery in the address bar while editing:

    Regards,
    Paul

    #3002

    ollithomson
    Participant

    Hi Paul. That’s perfect. Thanks.

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

You must be logged in to reply to this topic.