Support

Account

Home Forums Front-end Issues Filter posts by ACF value Reply To: Filter posts by ACF value

  • Also tried this:

    <?php  if (is_page( 'testpagina' ) ) {
    // args
    
    $args = array(
    	'numberposts' => -1,
    	'post_type' => 'any',
    	'meta_query' => array(
    		'relation' => 'OR',
    		array(
    			'key' => 'niveau_jaren',
    			'value' => '%Jaar 1%',
    			'compare' => 'LIKE'
    		),
    		array(
    			'key' => 'niveau_jaren',
    			'value' => '%Jaar 3%',
    			'compare' => 'LIKE'
    		)
    	)
    );
     
    // get results
    $the_query = new WP_Query( $args );

    This should mean it gets the posts with value ‘Jaar 1’ or ‘Jaar 3’, right? I don’t get anything..