ThemeShaper Forums » Thematic

[closed]

posts_where problem

(2 posts)
  • Started 2 years ago by iCristiano
  • Latest reply from em hr
  • This topic is not resolved
  1. iCristiano
    Member

    Hi Thematic 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. When I say it breaks I mean I get a blank page in another archive page, for exemple! On home, where I have another 2 loops, it shows the page, the header, but the loops are empty.

    Any help?
    Thanks!

    Posted 2 years ago #
  2. Please read this and come to then new ThematicTheme Forums for support.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.