Support

Account

Home Forums Add-ons Repeater Field Relationship field in repeater field

Unread

Relationship field in repeater field

  • Hi,

    I have a problem with list post title and other properties of post in repeater field.

    Here is my code:

    <div class=”row second-page”>
    <?php $program_posts = get_field(‘programs’); ?>
    <!– Shows list–>
    <div class=”col-md-9″>
    <?php $i = 0; foreach ($program_posts as $post) {
    $i++; ?>
    <?php setup_postdata($post);
    $field = get_field_object(‘show_category’);
    $value = $field[‘value’];
    $label = $field[‘choices’][ $value ];
    ?>
    ” id=”<?php echo $value; ?>” class=”show-block”>
    <p class=”show-block__category”><?php echo $label; ?></p>
    <h1 class=”show-block__title”><?php the_title(); ?></h1>
    <p><?php the_content(); ?></p>

    <?php if (get_field(‘program_list’)): $i = 0; ?>
    <div class=”col-md-12 show-page__video”>
    <div class=”row”>
    <?php while (have_rows(‘program_list’)): the_row();
    $i++; ?>
    <div class=”col-md-12″>
    <?php the_sub_field(‘program_time’); ?>
    <?php print count(get_sub_field(‘program_show’)); ?>

    <?php $myposts = get_sub_field(‘program_show’);
    if ($myposts): ?>
    <div class=”col-md-12 section section–grey”>
    <div class=”row”>
    <?php foreach ($myposts as $show): ?>
    Here i am getting title from $post, and I want title from $show
    <?php the_title(); ?>
    <?php endforeach; ?>
    </div>
    </div>
    <?php endif; ?>
    </div>
    <?php endwhile; ?>
    </div>
    </div>
    <?php endif; ?>
    <?php } ?>
    <?php wp_reset_postdata(); ?>
    </div>
    </div>

Viewing 1 post (of 1 total)

The topic ‘Relationship field in repeater field’ is closed to new replies.