Support » Plugins » How to use set_query_vars

  • Hi,

    I’m trying to make a plugin that filters posts that appear on 2 categories…

    For testing purposes I did this:

    add_action('parse_request', 'dualcatsfilter' );
    function dualcatsfilter( $cat1 = 14, $cat2 = 79 ){
    	global $wp;
    	$wp->set_query_var('category__and', array($cat1, $cat2));

    But it doesn’t work… I’m thinking that maybe I didn’t understand how to use the set_query_var function.

    Can anyone help me around?


  • The topic ‘How to use set_query_vars’ is closed to new replies.