Support

Account

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

Unread

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?
    Cheers,
    Jes

    Here’s the code:

    <?php
    $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)

The topic ‘Can just get one entry in repeater’ is closed to new replies.