So useful!
-
Besides tying widgets to specific pages, I have been using the random function to make widgets rotate at random. I don’t see it under the “Other Notes” tab and I forget where I found the idea, so I’ll repeat it here.
On the first widget you want to randomly rotate, put code like this:
global $my_random_widget; $my_random_widget=rand(1,4); return ($my_random_widget==1);My example above assumes I will have a total of 4 widgets to rotate. If you have more or less, change “4” to your total.
Then on each subsequent widget, just put in:
return ($my_random_widget==2);and change “2” on the third one you do to “3”, etc.
So easy!
The topic ‘So useful!’ is closed to new replies.