Support

Account

Home Forums Add-ons Repeater Field Display repeater child field value Reply To: Display repeater child field value

  • Hello,
    I have the following code

    <?php $post_objects = get_field('repeater_related_items');
    if( $post_objects ): ?>
        <ul>
        <?php foreach( $post_objects as $post): // variable must be called $post (IMPORTANT) ?>
            <?php setup_postdata($post); ?>
            <li>
                <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                <span><?php the_field('repeater_related_items'); ?></span>
            </li>
        <?php endforeach;?>
        </ul>
    <?php wp_reset_postdata(); ?>  
    <?php endif;?>
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Main Sidebar') ) : endif; ?>

    The problem is that when I add this to sidebar other widget doesn’t work.