WordPress.org

Ready to get started?Download WordPress

Forums

How to use set_query_vars (1 post)

  1. moikirsch
    Member
    Posted 5 years ago #

    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?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic