Home › Forums › General Issues › Issue getting options from pre_get_posts filter › Reply To: Issue getting options from pre_get_posts filter
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.
FYI
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!
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.