Quote:
Originally Posted by garce
I have no idea what I was thinking back then. Right now I'm thinking I don't want a post from 2005 to pop up on my index page. If the random call would only include the last month's posts - fine.
|
here you have:
Code:
<?php
function filter_where($where = '') {
//posts for last month
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
query_posts('numberposts=10&orderby=rand');
?>
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth
|