I'm trying to put 3 different random images on the same page. In my template, I just put:
PHP Code:
<?php random_content('Square-Images'); ?>
<?php random_content('Square-Images'); ?>
<?php random_content('Square-Images'); ?>
But this causes occasional duplicate images. Is there a way to achieve this so there are 3 unique random images on the page every time?
Thank you.
use an array and randomize the array
I suppose AndersonMM is using the
Random Content plugin.
If so, function
random_content displays the output but doesn't return it, therefore it should be patched, or create a new modified one.
(2015-09-19, 20:41:45)Carlos Wrote: [ -> ]I suppose AndersonMM is using the Random Content plugin.
If so, function random_content displays the output but doesn't return it, therefore it should be patched, or create a new modified one.
In this case, a randomized array using
random_content would not help me?
You could use object buffering into an array and remove duplicates then randomize output.
Of course like I said
Getfiles() and array random is better
shawn_a would you possibly be able to provide me a bit more of a snippet/example to get me going with that? Thank you for the Saturday support