如何使用可见性条件显示不超过30天的帖子,如下所述:https://docs.dynamic.ooo/article/58-visibility-triggers-custom-condition我试过这样的
$date_args =
array(
\'key\' => \'date\',
\'compare\' => \'>\',
\'value\' => date("Y-m-d"),
\'type\' => \'DATE\'
),
array(
\'key\' => \'date\',
\'compare\' => \'<=\',
\'value\' => date("Y-m-d", strtotime("-30 days")),
\'type\' => \'DATE\'
),
);
$date_query = new WP_Query( $date_args );
或者这个:
$value = get_post_meta (get_the_date( \'l F j, Y\' )) ;
if ($value < 30){
Return true;
}
但我不知道如何实现它。