Hello everyone,
I’ve been looking for a solution for a while. We now have a list with employee name and birthdate. We would like to have a sorting of the coming 6 birthdays. date of birth field is a datepicker.
This is our code:
<?php
echo '<table style="width:100%; text-align:left;">';
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Verjaardag</th>";
echo "</tr>";
$loop = new WP_Query( array( 'post_type' => 'medewerkers', 'posts_per_page' => 10 ) );
while ( $loop->have_posts() ) : $loop->the_post();
if ( have_rows( 'persoonsgegevens' ) ) :
while ( have_rows( 'persoonsgegevens' ) ) : the_row();
echo "<tr>";
echo "<td>", the_title( '' ), "</td>";
echo "<td>", the_sub_field('geboortedatum'), "</td>";
echo "</tr>";
endwhile;
endif;
endwhile;
echo "</table>";
?>