Yes! I was just about to post the same thing, all works now 🙂
Thanks so much for your help John.
Hi John, Thank you for your help…
Unfortunately, it didn’t work.
It just returns all sites.
I tried changing the posts__in line to the following (just to see if it mad a difference) but still just returns all sites instead of the 3 it’s supposed to.
'posts__in' => array(46,89,35),
Just for clarification, if I do the following…
$sites = get_field('site');
print_r($sites);
It returns…
Array ( [0] => 46 [1] => 89 [2] => 35 )
posts__in doesn’t seem to be working as it should.
Thanks again for your help on this.
I guess the question here is…
How would one query a post type, by a custom field that links to it from a different post type?
Hi anojszewski,
Can you please tell me where exactly you added this line?
I am using ACF PRO and I am using Post Object field type to get a list from a custom post type but it is ridiculously slow (basically unusable).
Can you tell me which function I can add this line…
$options['no_found_rows'] = true;
Thanks for your help in advance.
Hi Jonathan,
Thanks so much for your reply.
The JSON method is absolutely brilliant. So simple to implement and I definitely like the fact that I wouldn’t have to change the PHP code every time I add a new field…I was actually worried about having to do this.
Just to clarify though, we are talking about load times being reduced through out the entire site right? Not just when loading the ACF groups in admin…right?
I mean, when a post on the front end is being loaded, and this particular post uses 100 or more different ACF fields, will the JSON method reduce the time it takes to load this particular post?
Thanks again
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.