[英]Display 3 posts per page order by published date DESC in Wordpress
[英]wordpress display posts published with a publish date in the future
需要wordpress问题的帮助。
我需要编辑query.php以仅获取今天或将来发布的帖子。 我通过改变来获得未来的罚款:
$where .= " AND ($wpdb->posts.post_status = 'publish'";
至
$where .= " AND ($wpdb->posts.post_status = 'publish' OR";
$where .= " $wpdb->posts.post_status = 'future'";
但我还是老帖子
有任何想法吗?
谢谢
编辑:我有
iv got in $where .= " AND $wpdb->posts.post_date >= '" . date('Y-m-d') . "' ";
但它没有看到影响结果。 我已经回复了$ where和日期显示为2011-11-22,有谁知道这是否是正确的格式?
我对wordpress不是很熟悉,但是发布会返回具有该状态的所有内容,因此包括过去发布的帖子。
你应该能够做类似的事情
$where .= " AND $wpdb->posts.post_status = 'publish'";
$where .= " AND $wpdb->posts.post_date >= NOW()";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.