Skip to content

Instantly share code, notes, and snippets.

View ribeirovictor's full-sized avatar
🏠
Working from home

Victor Ribeiro ribeirovictor

🏠
Working from home
View GitHub Profile
@ribeirovictor
ribeirovictor / acf-future-posts.php
Created June 22, 2019 15:27 — forked from aderaaij/acf-future-posts.php
Advanced Custom Fields datepicker: Show only events with a date of today or in the future. Extra comments from Pasnon @ ACF Forums: f you needed to, you could also play with the comparison date, which is the first array in meta_query, currently set to date("Y-m-d") which is today; if you were to make it date("Y-m-d", strtotime("-1 day")) you cou…
<?php
/*
* Display posts only from today and in the future:
* http://old.support.advancedcustomfields.com/discussion/6000/how-to-sort-posts-by-acf-date-and-display-only-future-posts
* by Pasnon
*/
$date_args = array(
'post_type' => 'events',