Show a random slider on any given page

Lets say you’ve created 5 sliders, and want to show one of the 5 sliders randomly every time your web page loads.

This can be accomplished by using the “php method” described here, along with a little extra code.

 

 

 

Now that we’ve generated a slider’s “alias” randomly, it can be used in conjunction with any of the methods listed here. So if we wanted to only include a random slider on the site’s homepage, for example, we could use the following “php method”:

 

… and change the “slider1” part, to our new randomized alias variable, which would look like this:

 

… and then the updated code for showing a random slider on the homepage only would look like this: