jeudi 25 mai 2017

rand() Repeating on Archives

I'm using this to choose random images on a archive however its using the same image 2 or 3 times on each paginated archive page.

Any way to make sure it only chooses a unique image?

$random_image = sprintf( '%s/random/%s.png', get_stylesheet_directory_uri(), rand( 6, 1 ) );




Aucun commentaire:

Enregistrer un commentaire