Home › Forums › Add-ons › Repeater Field › Repeater Row Not Rendering
I’m having an issue with the third row ‘events‘ only one field is rendering event_ticket_url, all other fields are not showing up at all.
shows and hero work fine. maybe I’m missing somthing
<?php
/*
Template Name: Home
*/
?>
<?php get_header(); ?>
<div class="slider">
<div class='rotator'>
<?php if( have_rows('home-slider') ): ?>
<?php while( have_rows('home-slider') ): the_row();
// vars
$image = get_sub_field('hero');?>
<div class="image-sliders" style="background-image: url('<?php echo $image["url"]; ?>');"></div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'home' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; // End of the loop.
?>
<div class="container">
<div class="row">
<div class="col-12">
<h1 class="white-front">Upcoming Shows</h1>
</div>
</div>
<div class="row">
<div class="owl-carousel owl-theme loop">
<?php if( have_rows('shows') ): ?>
<?php while( have_rows('shows') ): the_row();
// vars
$show_image = get_sub_field('show_image');
$date = get_sub_field('date');
$performer = get_sub_field('performer');
$admission = get_sub_field('admission');
$ticket_link = get_sub_field('ticket_link');
$show_page = get_sub_field('show_page');
$show_details = get_sub_field('show_details');
$ticket_instructions = get_sub_field('ticket_instructions');
$time = get_sub_field('time');
?>
<div class="item col-12">
<div class="card front-card">
<div class="card-img-top" style="background-image: url('<?php echo $show_image['url']; ?>');"> </div>
<div class="home-date"><?php echo $date; ?></div>
<div class="inner-card">
<a class="home" href="<?php echo $show_page; ?>"><?php echo $performer; ?></a>
<p><?php echo $show_details; ?></p>
<hr>
<p><b>Time:</b><?php echo $time; ?></p>
</div>
<div class="bottom">
<div class="admission"><?php echo $admission; ?></div><a href="<?php echo $ticket_link; ?>"><div class="btn-home"><?php echo $ticket_instructions; ?></div></a>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<div class="owl-controls">
<div class="owl-nav">
<div class="owl-prev">prev</div>
<div class="owl-next">next</div>
</div>
<div class="owl-dots">
<div class="owl-dot active"><span></span></div>
<div class="owl-dot"><span></span></div>
<div class="owl-dot"><span></span></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<h1 class="white-front">Events</h1>
</div>
</div>
<?php if( have_rows('events') ): ?>
<?php while( have_rows('events') ): the_row();
// vars
$event_date = get_sub_field('event-date');
$event_name = get_sub_field('event-name');
$event_time = get_sub_field('event-time');
$event_link = get_sub_field('event-link');
$event_button_text = get_sub_field('event-button-text');
$event_ticket_url = get_sub_field('event_ticket_url');
?>
<div class="row">
<div class="col-12">
<h3><?php echo $event_date; ?> </h3><a href="<?php echo $event_link; ?>"><?php echo $event_name; ?></a><?php echo $event_time; ?> <a href="<?php echo $event_ticket_url; ?>"><?php echo $event_button_text; ?></a>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();
?>
<script>
$('.rotator').cycle({
fx:'fade',
timeout: 2000
});
</script>
Within the events repeater, all of your field names except the one that is working use dashes in their field key names vs. underscores. Underscores are the default structure so I would check to make sure your variables are calling correct field names and it shouldn’t be event_date, event_name, etc. vs. event-date, event-name like you have.
The topic ‘Repeater Row Not Rendering’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.