Support

Account

Home Forums ACF PRO Display Options Page repeater field in header.php

Solved

Display Options Page repeater field in header.php

  • I have a Repeater Field Group on an Options Page called “Address Book”. I would like to display the Phone Number (text field), of my first entry, in the WordPress Header.php.

    I can’t find any documentation on how to do this.

    I found something like this in the support forums but it’s not working.

    <?php
    $rows = get_field(‘location’, ‘option’); // get all the rows
    $first_row = $rows[0]; // get the first row
    $first_row_phone = $first_row[‘location_phone’ ]; // get the sub field value
    ?>
    <?php echo $first_row_phone[0]; ?>

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Display Options Page repeater field in header.php’ is closed to new replies.