Home>Support>How to display the fields from a repeater

How to display the fields from a repeater

By wordpress1, 6 years ago. Last reply by Alex S, 6 years ago.

Hey,

I can display all my fields with “$instance[‘example’]”. But how can i display the fields from my repeater?

thanks

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 6 years, 2 months ago Alex S
    Hi, I Work Here

    Hi,

    As in, the repeater values? If so, they’ll be stored in an array. If your repeater id is example and each item has a field with an id of name, to fetch the first repeater item you would use:

    $instance['example'][0]['name']

    The [0] being the repeater placement rather than a unique id. I would recommend using foreach to loop the repeater fields. For more information, please refer to this page.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More