WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
Forcing a post type (3 posts)

  1. stueynet
    Member
    Posted 6 months ago #

    I have seen some similar questions but most of them have really specific implementations and no answer yet. I am trying to do something a little more simple.

    My site has 3 different post types. I would like to simply force a post type that QMT retains in all of its queries.

    Based on the page / template on the site, I invoke a different version of the widget. I would simply like to be able to pass a post type to the Widget so that I can use the drill down for different post types, or multiple ones.

    I have checked the query_vars and even when the post type is in there, QMT doesn't see it. Looking at the code for QMT I don't see post type referenced anywhere.

    Thanks in advance for any guidance!

    http://wordpress.org/plugins/query-multiple-taxonomies/

  2. jpisanu
    Member
    Posted 2 months ago #

    I'm looking for the exact same thing, did you manage to solve it @stueynet?

  3. stueynet
    Member
    Posted 2 months ago #

    Hi jpisanu. You can set the QM base URL as follows. Other than that you need to achieve your goal in a variety of ways depending on your particular requirements. Unfortunately QMT is no longer being actively developed or supported so its tough to get help for it.

    add_filter( 'qmt_base_url', 'dl_qmt_base_url' );
    
    function dl_qmt_base_url( $base ) {
    
    	global $wp_query;
    	$the_post_type = $wp_query->query['post_type'];
    
    	if( $the_post_type == ''){
    	    return get_bloginfo('url');
    	} else {
    	    return get_bloginfo('url').'/'.$the_post_type.'/';
    	}
    
    }

Reply

You must log in to post.

About this Plugin

About this Topic