Home Forums Add-ons Repeater Field Can just get one entry in repeater


Can just get one entry in repeater

  • Hi!

    We are using a repeater on our front page to display banners. Well. That’s the idea anyway. I can just get one banner to displayed. If I try to add another banner the first one disappears.

    Any ideas why?

    Here’s the code:

    $frontpage_id = get_option( ‘page_on_front’ );

    if ( have_rows(‘banners’, $frontpage_id) ): ?>

    <?php while ( have_rows(‘banners’, $frontpage_id) ) : the_row();

    $image = get_sub_field(‘banner_bild’,$frontpage_id);
    $url = get_sub_field(‘banner_url’,$frontpage_id);
    $id = get_sub_field(‘banner_id’,$frontpage_id);
    if ( !empty($image) ): ?>
    ” target=”_blank”>
    ” alt=”<?php echo $image[‘alt’]; ?>” id=”<?= $id ?>” />

    <?php endif;

    endwhile; ?>

    <?php endif;


Viewing 1 post (of 1 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.