【发布时间】:2019-11-07 19:22:41
【问题描述】:
我创建了一个 WordPress 帖子过滤器页面。我想按日期、月份和年份过滤帖子。我该怎么做?
样本..
's' => (!empty($_REQUEST["search"])?$_REQUEST["search"]:''),
'post_type' => 'post',
'post_status' =>'publish',
'cat' => 5,
'posts_per_page' => 9,
'paged' => 1,
(!empty($_GET["monthnum"])?'monthnum' =>$_GET["monthnum"]:false),
(!empty($_GET["year"]))?'year' => $_GET["year"]:false),
'orderby' =>!empty($_GET["orderby"])?$_GET["orderby"]:'date'
);```
【问题讨论】: