Query Loop not pulling ACF URL or File fields into button link

Hello, and thank you for any help in advance!

I am using GB Query Loops to create loops for different post categories and have ACF custom fields set up for each category to set up file downloads and outgoing to links. It is working beautifully on this page: News – International Association of Fairs and Expos (sg-host.com), but not on this page: Job Opportunities – International Association of Fairs and Expos (sg-host.com)

I have the Dynamic Data settings set up in exactly the same way and query loops are working as expected. (pulling the correct taxonomies) But on the jobs loop, when viewing the front-end, the button links are empty.

News Settings


Settings for job button is exactly the same with the post meta field being the one associated with the job posts. (And yes, I’ve tried copy/pasting the field directly from ACF settings, typing it out, checking for typos, etc.)

Both the news link and the job link are ACF URL fields, and I have tried removing the job posting field (ACF File field) to see if the additional field/field type was possibly the issue, but no luck there.

I feel like I am going crazy: I’ve tried rebuilding the loop, rebuilding the ACF field group/fields, etc. Has anyone encountered a similar scenario, and were you able to find a solution? Or does anyone other ideas for troubleshooting?

Hi @Marisa,

Can you try creating a new field for Jobs with the exact settings as the one in News? Use a different field name. Test if this new field’s value is retrievable.

If it is, it may be a database issue or something else.

No luck recreating with a new field name. But that is another thing to cross off the troubleshooting list. (Thank you!) I’ll update with solution if I do find one, but need to chase down another gremlin or two since the site went live today. Thank you for your help! :slight_smile:

I see. That’s really odd. If you create a new custom post meta field for Job, is it retrievable?

Odd indeed. :confused:

After doing some more testing and opening up the database, it looks like the fields are being created, but are not having data saved to them from the jobs posts. I determined this was not a generate blocks error: after switching the field type to an array, generate blocks would show a link to an empty array. So, this can be considered closed in terms of being a generator blocks issue.

For anyone that might encounter the same problem, I think this may be the same wordpress not saving/refreshing post meta data if the fields were not set on initial post creation described here:
Custom Fields do not save when creating a new page · Issue #653 · AdvancedCustomFields/acf · GitHub

(Makes sense because my news posts have not been edited, but I changed my mind on how I wanted the job post fields to work, so fiddled with it, and then it stopped working.)

I see. Glad you found the cause, and thank you for sharing!