Home Forums General Issues Foreach Tab


Foreach Tab

  • I have a page with 4 ACF tabs. is there a way in my template to include a foreach tab function?


  • Tabs are not actually fields and are not stored. The fields in each tab are not associated with the tab in any way. Tabs are just an admin layout feature of ACF. So really, there is nothing in ACF itself that will allow you to do this.

    If I found myself needing to do this I would probably create a nested array that defined the fields I wanted to show for each tab and then loop through that array to create the foreach tab effect, something like:

    $array = (
        // these are the field names for tab 1
        // these are the field names for tab 2
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Foreach Tab’ is closed to new replies.