'blue', 'post_type' => 'product', "meta_query" => array( array( "key" => "_sku", "value" => $sku, "compare" => "LIKE" ) ) ); // The Query $the_query2 = new WP_Query( $args ); // The Loop if ( $the_query2->have_posts() ) { echo ''; /* Restore original Post Data */ wp_reset_postdata(); $esData = '{"sku" : '.$sku.'}'; $ch = curl_init('http://data.carport.com/search/sku'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $esData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($esData)) ); $esResult = curl_exec($ch); } else { // no posts found } ?>