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..
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.