Skip to content

Instantly share code, notes, and snippets.

@be-mohand
Created April 26, 2020 12:48
Show Gist options
  • Save be-mohand/7a7930ee30c9eb060ccb321c7eaa20aa to your computer and use it in GitHub Desktop.
Save be-mohand/7a7930ee30c9eb060ccb321c7eaa20aa to your computer and use it in GitHub Desktop.
Display random listings on your Kreezalid homepage
1. Configure your homepage to load enough listings on your homepage. Let's say 100.
2. Update the homepage-listings snippets in the theme editor:
2.1. Add {% assign shuffled_listings = listings-section.listings | shuffle %} at the beginning of the snippet
2.2. Update the for loop to iterate on shuffled_listings instead of listings-section.listings. You can also limit the number of listing to display with the limit parameter:
{% for listing in shuffled_listings limit:8 %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment