Skip to content

Instantly share code, notes, and snippets.

@guilhermealveslopes
Created April 19, 2017 21:38
Show Gist options
  • Save guilhermealveslopes/51d0896cbced05a2ba88ff5dc2bd2f9e to your computer and use it in GitHub Desktop.
Save guilhermealveslopes/51d0896cbced05a2ba88ff5dc2bd2f9e to your computer and use it in GitHub Desktop.
Filtra post, removendo anteriores a data atual.
/* 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