Home Forums Add-ons Repeater Field The Word Array Displays


The Word Array Displays

  • I have a client that has a repeating list of communities. I wrote a script to add a counting id number to each community to create an anchor link for the page. The script works but also displays the word “ARRAY”. I have been racking my brain on how to fix this. Any thoughts?

    <?php if( have_rows('communities') ): ?>
    $i = 1;
    while(have_rows('communities')): echo '<div id="community-' . $i . '">' . the_row() . the_sub_field('community_name'); '</div>';
    <?php the_sub_field('community_slideshow'); ?>
    <?php the_sub_field('community_description'); ?>
    <a href="#top">Back to top</a>
    <?php endwhile; ?>
    <?php endif; ?> 
    • James

    • July 28, 2019 at 2:04 am

    Hi @fultonman

    Is it possible that one of your two subfields is returning an array and not a string?
    Could you debug the output from your repeater rows using var_dump() function?

  • Thanks. I was able to get it to work.

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.