This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

How to display the fields from a repeater

Open 1 reply developergeneral
7 years ago · Last reply by Alex S 7 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.

Need fast email support? Get SiteOrigin Premium

Replies

1
  1. Alex S Staff 7 years, 7 months ago

    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.

Have a different question or issue?

Start New Thread