Show dynamic random data in cornerstone

Hey there,

My question is - can we show random data from the selected categories post/portfolio dynamically in cornerstone?
the scenario is -
I have created a grid, where I just want to show a single post detail at a time, but I want a different one each time they refresh the page.
Do we have such a feature available in cornerstone? Or do we need to write a custom code in the function.php file in order to make this work?

Please suggest.
Thanks!

Hello @klevur,

Thanks for writing to us.

You can use Looper to display a random post. Please follow these steps.

  1. Set the Looper provider as Query Builder
  2. Select the post types from the Post settings
  3. Select the category from the Taxonomies select box.
  4. You need to select OrderBy as Random.
    Please have a look at the given screenshot below.

Now you need to use the dynamic content to display the post data for example to display the post title you can use this dynamic content code. {{dc:post:title}}. You need to click on this Icon to get the list of dynamic content codes.

In case you have not seen the doc of Looper please have a look at it.

Hope it helps
Thanks

Hi @prakash_s

Yes, I’m aware of the dynamic looper, I was just curious about the “Random” option in cornerstone settings.
And the information you provided about that helped, thanks for the information!

Have a great day!
Thanks!

Hello @klevur,

Glad that we were able to help you. Please feel free to reach us if you have any more concerns.

Have a great day!
Thanks

1 Like

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