WordPress 获取一定天数内发表的文章代码:
- <?php
- function filter_where($where = '') {
- $where .= " AND post_date > '" . date('Y-m-d', strtotime('-60 days')) . "'";
- return $where;
- }
- add_filter('posts_where', 'filter_where');
- query_posts($query_string);
- ?>
默认是60天内的文章。
将代码添加到主循环的上面。

版权声明
本站原创文章转载请注明文章出处
2015年1月21日 15点55分 1F
2015年1月22日 23点00分 2F
下载按钮的广告怎么做
2015年10月20日 23点45分 3F
文章看不到,鸟哥
2017年10月11日 13点13分 4F
如何调用一定天数内的热门文章或是调用一定数量的推荐文章?
或是调用 自定义某星级的文章?