Support

Account

Forum Replies Created

  • 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?

  • I updated my field to be on each post from options, so from options to post meta.

    I tried using get_field inside pre_get_posts and it didnt work, what worked though is when I used get_post_meta, using the global $post->ID as my reference. Is using get_post_meta okay? Just want to make sure this doesnt create any issues in the future.

Viewing 2 posts - 1 through 2 (of 2 total)