I want to print posts if Custom Field Value (Expiry) formatted as 31 April 2021 is equal to or greater than today date (19 April 2021). I have tried with the below code but not working.
<table>
<thead>
<tr>
<th>Title</th><th>Click</th>
</tr>
</thead>
<?php
$today = strtotime(date('d F Y'));
$datecf = get_post_meta($post->ID, 'Expiry', true );
$cfdate = (!empty($datecf))? strtotime($datecf) : false;
if($today <= $cfdate){
?>
<tbody>
<tr>
<td><?php the_title(); ?></td>
<td><a href="<?php the_permalink(); ?>">Check Here</a> </span> </td> </tr>
<?php
}
// Posts not found
else {
?>
<tr>
<td><p>There is no Active Posts Now, Check Tommorrow!</p></td>
</tr>
<?php
}
?>
</tbody>
</table>