WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out how to get the following code to work as one wp_query . i'm trying to filter the loop on the search values and the taxonomy values:

Both of these sections work independently but i'm looking to tie these into one query..?

I have tried various combinations but am getting no where....any ideas of the best approach to this issue...?

    global $query_string;

    $query_args = explode("&", $query_string);
    $search_query = array();

    foreach($query_args as $key => $string) {
        $query_split = explode("=", $string);
        $search_query[$query_split[0]] = $query_split[1];
    } // foreach
    $args = array(
    'post_type' => 'listings',
    's' => 's',
    'keyword' => $search_query['s'],
    'tax_query' => array(
        'relation' => 'AND',
        array(
            'taxonomy' => 'type',
            'field' => 'slug',
            'terms' => $search_query['type']
        ),
        array(
            'taxonomy' => 'rooms',
            'field' => 'slug',
            'terms' => $search_query['rooms']
        )
    )
);
    $the_query = new WP_Query($args);
share|improve this question

closed as off-topic by kaiser Feb 17 '14 at 23:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

    
There's nothing like a "keyword search" in WP. What exactly are you referring to? A plugin probably? – kaiser Feb 17 '14 at 23:47

Browse other questions tagged or ask your own question.