its pre_get_posts, it doesnt return or log anything on the error logs because it gives an error 500 each time I use it. I used the same code on a template file(ie. single.php) and the same code returns an array of post ids. Its only on pre_get_posts on functions.php that the code behaves differently.
I updated this to fetch a custom field on the post and not the options, get_field still doesnt function properly inside pre_get_posts, I used get_post_meta instead and it worked. Maybe get_field doesnt work around the time pre_get_posts is being called?
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!
© 2023 Advanced Custom Fields.