Home › Forums › General Issues › Numberposts & Meta Query Not Working › Reply To: Numberposts & Meta Query Not Working
Your question has made me realise that the issue is probably not with the ACF part but the Custom Post Types taxonomy I was querying.
get_field is correctly pulling the field ID. However, my $args was not querying for posts filtered by taxonomy. I’ve changed the code to:
<?php $relatedCat = get_field('service_related_industry');
$args = array (
'posts_per_page' => 3,
'post_type' => 'case_study',
'tag_id' => '"'.$relatedCat.'"',
'orderby' => 'DESC',
It’s still not working properly, but at least now it isn’t pulling all the posts (it’s pulling exactly the 3 latest, while ignoring the ‘tag_id’ filter).
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.