Viewing 1 replies (of 1 total)
  • Thread Starter Neil.Hill

    (@neilhill)

    Well I’ll be damned, Attempt 2 started working. Must’ve made a change to it at some point without noticing. I’m too ill for this.

    Just for reference if anyone else come across this, I got it working with

    <?php
    
    		if(isset($_POST['searchField'])){
    		$params=array(
    			'posts_per_page' => -1,
    			'post_type' => 'is-allowed',
    			'meta_key'=>'product',
    			'meta_value'=>$_POST['searchField'],
    			'meta_compare' => 'LIKE',
    			);
    			$query = new WP_Query;
    			$posts = $query->query($params);
    
    	?>
Viewing 1 replies (of 1 total)

The topic ‘WP_Query using meta_query returns 1 record’ is closed to new replies.