ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Order By Random Not Working

November 07, 2012 11:45pm

Subscribe [2]
  • #1 / Nov 07, 2012 11:45pm

    brianrivet

    48 posts

    Hi,

    I’m having some trouble with an order_by=“random” parameter in one of my templates. I’m running 2.3.1.

    Here’s my code:

    {exp:channel:entries channel='commodities' disable='trackbacks|pagination' dynamic='no' limit='2' order_by='random' category='{this_month_id}'}
        <article class="span6">
         <a href="http://{page_url}">{exp:channel_images:images entry_id="{entry_id}" limit="1"}{image:url:medium}{/exp:channel_images:images}</a>
         <a href="http://{page_url}"><em>{title}</em></a>
        </article>
       {/exp:channel:entries}

    The tag is outputting everything correctly, but it is always the same two entries. I have checked and I don’t have caching turned on in the template. Can anyone point to how I might make it start randomly pulling the entries?

    Thanks,

    Brian

  • #2 / Nov 08, 2012 2:56pm

    Shane Eckert

    7174 posts

    Hey brianrivet,

    Thank you for posting your question.

    Please change

    order_by=

    to

    orderby=

    Cheers,

  • #3 / Nov 08, 2012 7:42pm

    brianrivet

    48 posts

    ugh. Thanks. I’ve been looking at this too long apparently.

  • #4 / Nov 09, 2012 3:50pm

    Kevin Smith

    4784 posts

    Glad Shane could help! 😊

    Have a good one, Brian.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases