Answers.Body: <p><code>.order()</code> is deprecated in Craft 3 and doesn't work in Craft 4, use <code>orderBy()</code> instead.</p>
  <pre><code>{% for entry in craft.entries.section('team').type('mainPeople').orderBy('RAND()') %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-16T17:32:48.977Z
Answers.LastActivityDate: 2023-03-16T23:56:08.523Z
Answers.LastEditDate: 2023-03-16T23:56:08.523Z
Answers.UserDisplayName: Samuel
Answers.Body: <p>You can use MySQL's <a href="http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand">RAND()</a> function inside your order method:</p>
  
  <pre><code>{% for entry in craft.entries.section('team').type('mainPeople').order('RAND()') %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-23T12:35:31.290Z
Answers.Text: Doh! I'd tried that, but forgot the quote marks. Thanks.
Answers.UserDisplayName: Willans
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-23T11:20:58.700Z
Answers.LastActivityDate: 2014-09-23T11:20:58.700Z
Answers.UserDisplayName: Mike Pepper
Body: <p>I was wondering if it's was possible to order section entries by random.</p>
  
  <p>Example:</p>
  
  <pre><code>{% for entry in craft.entries.section('team').type('mainPeople').order('title random)) %}
  </code></pre>
  
Tags: <templating><entries><ordering>
Title: Section entries - order by random
ThreadText: # Section entries - order by random
  
  (Asked by: username_0 on 2014-09-23)
  
  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)) %}
  
  ```
  
  **Tags:** templating, entries, ordering
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2014-09-23. Score: 48 | Accepted answer
  
  You can use MySQL's [RAND()](http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand) function inside your order method:
  
  ```
  {% for entry in craft.entries.section('team').type('mainPeople').order('RAND()') %}
  
  ```
  
  > **Comments:**
  > **username_0**: Doh! I'd tried that, but forgot the quote marks. Thanks.  
  
  ---
  
  ### Answer by username_1 on 2023-03-16. Score: 1
  
  `.order()` is deprecated in Craft 3 and doesn't work in Craft 4, use `orderBy()` instead.
  
  ```
  {% for entry in craft.entries.section('team').type('mainPeople').orderBy('RAND()') %}
  
  ```
  
  
  ---
  
  