posts_where problem
-
Hi WP friends,
I have a taxonomy called “genero”. I´m trying to limit my “genero” archive page to just show future posts, like an event page.
So, I used this code:
function filter_where( $where ) { if(is_tax(genero)){ $where .= " AND post_date > '" . date('Y-m-d', strtotime('0 days')) . "'"; } return $where; } add_filter( 'posts_where', 'filter_where' ); function reset_filter_where() { if(is_tax(genero)){ remove_filter( 'posts_where', 'filter_where' ); } } add_action('thematic_below_archiveloop','reset_filter_where');It works great on the genero´s archive page, but it breaks all the other looping on other pages. I don´t know what is happening.
Any help?
Thanks!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘posts_where problem’ is closed to new replies.