Home › Forums › Front-end Issues › How to search ACF Post Object Type Field › Reply To: How to search ACF Post Object Type Field
Replace ‘paged’ => $paged by ‘posts_per_page’ => -1,
$args = array(
'post_type' => 'recipes',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'cookies_products_used',
'value' => $ptype,
'compare' => 'LIKE'
)
)
);
// start get values you want
$the_query = new WP_Query($args);
if ($the_query->have_posts()) {
while ($the_query->have_posts()) {
$the_query->the_post();
// for example
$cookies_products_used = get_field('cookies_products_used',get_the_ID());
}
}
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.