I have a Repeater Group setup using Advanced Custom Fields Pro in Wordpress. I want to set up a script that will remove/hide the repeater row in the front-end after the date picker date is after the current date.
Here is the code snippet i'm using for the page to display the date rows:
<?php
if (have_rows('location')) {
?>
<div class="tab-pane fade" id="location_name" role="tabpanel"
aria-labelledby="location-tab">
<?php while (have_rows('location')) {
the_row(); ?>
<div class="tab_col usual_text date_col">
<?php
$orgDate = get_sub_field('date');
$newDate = date("l, F d", strtotime($orgDate));
echo $newDate; ?>
</div>
<div class="tab_col usual_text time_col">
<?php the_sub_field('time'); ?>
</div>
<div class="tab_col additional_info">
<?php the_sub_field('additional_info'); ?>
</div>
<div class="tab_col btn_col">
<a class="dark_btn" href="<?php the_sub_field('buy_url'); ?>">
</a>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
My goal is to look at the sub field "time" and compare it with the current date and if it has past, not display this whole row.
Even further, if all of these rows have past, I want to identify that and return a different layout. I just need to identify what if/else statement I could write to determine all these rows are gone.
Any assistance would be great! Thank you.