How do I make my array query into a string query in wordpress?

Due to the way I have set up my template, I need to have the following in a string url format:

$the_query = array( 'post_type' => 'product', 'taxonomy' => 'product_types', 'term' => 'solar-panel' )

I thought something like

Read More
$the_query = new WP_Query( 'post_type=product&taxonomy=product_types&term=solar-panel&showposts=2' )

but this isn’t working due to the fact that taxonomy is an array in itself. Thanks.

Related posts

Leave a Reply

1 comment

  1. Will your template allow you to set your options outside of WP_Query?

    $args=array(
      'post_type' => 'product',
      'taxonomy' => 'product_types',
      'term' => 'solar-panel',
    );
    
    $the_query = new WP_Query($args);
    

    If not, what about your template won’t allow you to do this? Could you post some code?