Home › Forums › Add-ons › Repeater Field › future dates table in single.php › Reply To: future dates table in single.php
The code I posted should have been put after the while statement you already had, something like this.
<?php
// check if the repeater field has rows of data
if( have_rows('t_block') ):
echo "<table>";
// loop through the rows of data
while ( have_rows('t_block') ) : the_row();
while ( have_rows('t_block') ) : the_row();
$now = strtotime(date('Y-m-d', time()));
// I am assuming that your date is stored as 'Y-m-d'
// see strtotime php doc form more information
$end_time - strtotime(get_sub_field('ende'));
if ($now > $end_time) {
// not in the future, go to the next row
continue;
}
I was showing you where to put it by including the while in my code example rather than copying and pasting all of your code.
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.