我目前的代碼顯示cpt'events'的5個帖子。這是我使用的代碼:僅顯示未來事件(cpt)
//get post type ==> events
global $post;
$args = array(
'post_type' => 'events',
'numberposts' => $data['home_events_count'],
'orderby' => 'meta_value',
'meta_key' => 'timestamp_earth_event_start_date',
'meta_query' => $meta_query
);
我想篩選出的職位(事件),他們的「timestamp_earth_event_start_date」比當前日期的。
我試着自己修改代碼,但仍顯示過去的事件。
任何幫助將不勝感激!
添加濾鏡我更新這個問題什麼timestamp_earth_event_start_date指的是?這是什麼類型的領域,一個自定義領域? – SMacFadyen
timestamp_earth_event_start_date是保存事件開始日期的自定義字段 – user2093301
timestamp_earth?你是否保持你的功能開放,以便你可以支持你的代碼在其他星球上? – TravisO