Created
April 19, 2017 21:38
-
-
Save guilhermealveslopes/51d0896cbced05a2ba88ff5dc2bd2f9e to your computer and use it in GitHub Desktop.
Filtra post, removendo anteriores a data atual.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* On loop */ | |
$today = date( 'Y-m-d' ); | |
$date = get_field('data', false, false); /* Get the ACF date field */ | |
$date = new DateTime($date); | |
if(strtotime($today) <= strtotime($date->format('Y-m-d') ) ): /* Verifica se a data do post é menor que a data atual */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://wordpress.stackexchange.com/questions/195631/hide-old-events-custom-post-type