Support

Account

Home Forums General Issues Meta-query is not working Reply To: Meta-query is not working

  • This is my code now:

    $fastigheter = get_posts ([
    	'post_type' => 'fastigheter',
    	'numberposts' => -1,
    	'meta-query' => [
    		'relation' => 'OR',
    		[
    		        'key' => 'byggstatus',
    			'value' => 'Renoveras',
    			'compare' => '='
    		],
    		[
    			'key' => 'byggstatus',
    			'value' => 'Under Uppbyggnad',
    			'compare' => '='
    		]
    	]
    ]);

    I still get all the posts in the fastigheter cpt.