NO BUG: Wrong image for random query loop

Browser: Firefox
OS: macOS

Hello guys! I’m going crazy, even though I’m working on a simple structure. I need to show a box with photo and title of a random post (from custom post type). I created a template with a loop query div that contains a background photo and a post title. Reloading the page several times I see that the title often does not correspond to the background photo, which is from another post.
I hope I was clear
Thanks to anyone who can help me!

Hi Davide,
Welcome to the forum and thanks so much for your report!

Unfortunately, I cannot reproduce the issue.
Would you be so kind as to send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?

Best regards,
timmse

EDIT: The problem was most likely the TTL being set to “0”.
Minimum is “1”.

I am encountering the same bug.
When a query loop is set to random, it will take images from different random posts.
It does not matter if I use an image or a background, the result is the same.

Hi Dick,
Welcome to the forum!

Unfortunately, I never received a reply from the thread starter and still can’t reproduce the problem. Could it be that you are using caching?

Hi timmse, the problem was fixed for us by changing the TTL to something other than “0”.
That seemed to mess up the randomization.

It would be nice however, if the TTL on the randomization could have a setting to refresh the seed on each page load. That was what our developer was trying to achieve with the “0” setting for TTL.

This is exactly the case for me (and also the point) if I set the TTL value to 0. Unfortunately, I can’t give you a general answer as to why it isn’t working in your case.

Unfortunately I no longer have a copy of the buggy section.
If it happens again I will supply you with more details.

1 Like

Hi timmse, hi Dick!
@timmse sorry for the delay, I abandoned the project for a few months and found a different solution to avoid the “problem”.
@Dick Thanks for the solution, if the same situation happens to me again, I will definitely try your solution.
thank you both!