admin管理员组

文章数量:1130349

This code is working fine but when I select the only Bathroom Type It's not working. Please help me so that my multiple search system can be work properly.

$Bathroom_Type = implode(',', $_POST['room_type']);
$style_type = implode(',', $_POST['style_type']);

$args = array('post_type' => 'MyGallery',
          'meta_query'=> array(
          'relation' => 'AND',
               array('key' => 'Room',
                     'value' => $Bathroom_Type,
                     'compare' => 'IN'),
                         array('key' => 'Style',
                               'value' => '$style_type',
                               'compare' => 'IN')
               )
    );

//Show Result
$query = new WP_Query($args); 
if ( $query->have_posts() ) 
   {         
      while ( $query->have_posts() ) 
         {          
            $query->the_title();            
            echo the_title();
         }
   }

This code is working fine but when I select the only Bathroom Type It's not working. Please help me so that my multiple search system can be work properly.

$Bathroom_Type = implode(',', $_POST['room_type']);
$style_type = implode(',', $_POST['style_type']);

$args = array('post_type' => 'MyGallery',
          'meta_query'=> array(
          'relation' => 'AND',
               array('key' => 'Room',
                     'value' => $Bathroom_Type,
                     'compare' => 'IN'),
                         array('key' => 'Style',
                               'value' => '$style_type',
                               'compare' => 'IN')
               )
    );

//Show Result
$query = new WP_Query($args); 
if ( $query->have_posts() ) 
   {         
      while ( $query->have_posts() ) 
         {          
            $query->the_title();            
            echo the_title();
         }
   }

本文标签: wp queryNeed Help For WPQuery