Skip to content

Instantly share code, notes, and snippets.

@mikeott
Last active August 16, 2022 01:11
Show Gist options
  • Save mikeott/cf78113bfb69bdd99166ca3939fa455e to your computer and use it in GitHub Desktop.
Save mikeott/cf78113bfb69bdd99166ca3939fa455e to your computer and use it in GitHub Desktop.
ACF return a specific repeater field row value
$cast_members = get_field( 'cast_members'); /* The repeater field */
$row = $row[2]; /* The repeater field row number to target (start counting at 0) */
$character = $row['character']; /* The field to get */
echo $character; /* Echo the field */
@mikeott
Copy link
Author

mikeott commented Aug 16, 2022

ACF-fields

Taking these fields as an example, $character would return Howard Hamlin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment