Support

Account

Home Forums General Issues Getting ACF post_object inside wp_query Reply To: Getting ACF post_object inside wp_query

  • I do not see you using the second argument anywhere. Assuming that event_details is a field of $post, you should pass the post ID at least to have_rows(). In case this is not it, we should find out where exactly the problem occurs:

    • Have you checked if $post is being populated as intended?
    • Have you checked if the ID property of $post is “ID” and not “id” or “post_id”?
    • Have you factored in that when you call get_the_ID() you are asking for the ID of the current main loop item, for which you have called the template?