17

I was wondering if it's was possible to order section entries by random.

Example:

{% for entry in craft.entries.section('team').type('mainPeople').order('title random)) %}
42

You can use MySQL's RAND() function inside your order method:

{% for entry in craft.entries.section('team').type('mainPeople').order('RAND()') %}
  • Doh! I'd tried that, but forgot the quote marks. Thanks. – Willans Sep 23 '14 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.