Display of grid elements in random order when reloading page

I am using the x-theme and would like get help with one subject…
I have a couple of heads as toggle with a content area modal function inside a grid. The customer just came up with an idea. He would like to see the heads in different (random) order, when opening the page for a second time.


Within the next week, there will be more heads to be added.
Does anybody have experience with this?
Thanks in advance for your help.
cheers,
Marcus
PS: everything is up-to-date and I am using a child theme

Hey, @marcuz! Thanks for writing in, and what a great question! As of now the best way to do this would be a combination of creating a Custom Post Type in your child theme, and then referencing that Custom Post Type via a Looper, which you could then randomly order.

To do this, you’d need to first register and setup your Custom Post Type. There are a couple ways you can do this either via a plugin that helps you create one from within the WordPress admin interface, or you can manually set one up in your child theme. This article somewhat walks through the idea of both approaches:

Once you have you Custom Post Type setup, you could have it include fields for things like the user’s picture, their name, et cetera. Basically, anything you’ll want to reference later in the Looper.

Then, you can go setup your Grid and its Cells to be a Looper Provider somewhere in the tree by activating the Looper Provider under Customize, then going to the Query Builder and pulling in your appropriate Post Type. Finally, you can use the Orderby control to select a random order each time. If you haven’t used Loopers yet, we have extensive documentation and videos on them here:

That would be the best way to do something natively within the tool.

1 Like

Hey, @kory thx for yr quick reply.
I will definately look into it the next days and will get back to you when done.
May I come back to you, when problems occure?

chears,
Marcuz

Hi Marcuz,

Sure, you can come back to us if you faced any issues during the implementation of the above process.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.