Support

Account

Home Forums Add-ons Repeater Field Show one random row from a repeater field

Helping

Show one random row from a repeater field

  • Hi everybody

    I have a repeater field on my option page which contains 3 image fields.

    I am trying to make it so it returns a random row containing all the three subfields, but can’t find any examples like this, is there anyone who can help me on with this?

    Thanks

  • 
    $repater = get_field('repeater_field_name');
    $row = array_rand($repeater);
    var_dump($repeater[$row']);
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.