WP_Query – issues with rand
-
I have a custom taxonomy only for attachments, with a single option (YES) that can be checked. On the frontpage, I use WP_Query to retrieve all images which are marked, and randomise the output. In fact, I use two queries, first to get one random image and then the rest.
The output is really strange though – the first 6-7 images are pretty much always the same, randomised amongst themselves and then the rest of the images are shown more or less as they’re listed in the Media Library, with minimal variation. In total, we’re showing about 35 images.
As far as I can tell, there is nothing wrong with the code – http://pastebin.com/hzGV8HH5. I wonder if there is any limitation on using orderby=rand, or if there would be a different way of calling this?
I realise this isn’t much data to go on, but I’m pulling my hair out, so thought I’d post this in the off-chance someone might have some ideas..
The topic ‘WP_Query – issues with rand’ is closed to new replies.