Hi,
I have a subfield within a subfield and I can’t seem to get it to show on the front end. The only thing that shows up is the Date and time. I seem to have lost the Event type, Location, Title and Speaker (they’re my sub subfields). any help much appreciated! (My php skills are limited)
<?php if(get_field('event_programme')): ?>
<div id="g1-table-1" class="g1-table g1-table--solid ">
<?php while(has_sub_field('event_programme')): ?>
<table>
<caption><h2><?php echo date('l, M jS', strtotime(get_sub_field('date'))) ?></h2></caption>
<?php if(get_field('event_programme')): ?>
<?php while(has_sub_field('event_details')): ?>
<thead> <tr> <th colspan="3">
<?php the_sub_field('start_time'); ?> - <?php the_sub_field('end_time'); ?>
</th> </tr> </thead>
<?php if(get_field('event_details')): ?>
<?php while(has_sub_field('presentation_details')): ?>
<tbody> <tr><td><?php the_sub_field('event_type'); ?></td>
<td><?php the_sub_field('title'); ?><?php the_sub_field('speaker'); ?></td>
<td><?php the_sub_field('location'); ?></td></tr>
</tbody>
<?php endwhile; ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?> </table><p></p>
<?php endwhile; ?></div>
<?php endif; ?>
Ok I solved it – I should have pulled in
<?php if(get_field(‘event_programme’)): ?>
<?php while(has_sub_field(‘presentation_details’)): ?>
instead of
<?php if(get_field(‘event_details’)): ?>
<?php while(has_sub_field(‘presentation_details’)): ?>