Hallo,
kann mir hier vielleicht jemand helfen ?
Ich habe eine Termintabelle für eine single.php erstellt, was auch alles gut funktioniert, allerdings möchte ich nur die Termine anzeigen, die sich in der Zukunft befinden.
bei den ACF handelt es sich um Repeater felder
Hier der bisherige Code
HTML
<?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();
$date_beginn = DateTime::createFromFormat('Ymd', get_sub_field('beginn'));
$date_ende= DateTime::createFromFormat('Ymd', get_sub_field('ende'));
$preis= get_sub_field('preis');
$preis_ez= get_sub_field('ez_preis');
$buchbar= get_sub_field('buchbar');
$sprache= get_sub_field('sprache');
$anfrage= get_sub_field('anfrage');
$bemerkung= get_sub_field('bemerkung');
$garantiert= get_sub_field('garantiert');
// display a sub field value
echo '<tr> <td>' . $buchbar . '</td>';
echo '<td>' . $date_beginn->format('d.m.Y') . '</td>';
echo '<td>' . $date_ende->format('d.m.Y') . '</td>';
echo '<td><strong>' . $preis . ' EUR </strong> </td>';
echo '<td>' . $preis_ez . '</td>';
echo '<td>' . $sprache . '</td>';
echo '<td>' . $garantiert . '</td>';
echo '<td>' . $anfrage . '</td>';
echo '<td>' . $bemerkung . '</td> </tr>';
endwhile;
echo "</table>";
else :
endif;
Alles anzeigen