Hey.
I tried to implement the code at codex into my child theme functions.php to only return posts from the last 30 days, include search results to no avail. (I just pasted it into the functions file)
<?php
//based on Austin Matzko's code from wp-hackers email list
function filter_where($where = '') {
//posts in the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
query_posts($query_string);
?>
Also, does anyone know how to post a message above a single post page when it is over 30 days old.. ie if someone lands from a search engine they get a message saying 'this post is out of date, try these posts' sort of thing?
Thanks for any help on this.
BAC