Benim wordpress frontpage son X günün sadece mesajları göstermek istiyorum. Bir hafta, diyelim, yani 7 günlük en.
What's the propper way to tell wordpress to select only the posts in the last X day's in the loop?
Şu anda, o yalak kesmek çalışma var, ama o pagination kadar karışıyor. Sonraki sayfaya gitmek doğru mesajları seçmez.
//Hack found on the bottom of http://codex.wordpress.org/Template_Tags/query_posts
function filter_where($where = '') {
//posts in the last 7 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
}
add_filter('posts_where', 'filter_where');
query_posts($query_string);
if ( have_posts() ) : while ( have_posts() ) : the_post();
... and the usual