UPDATE: I can get things working, but then as soon as I change one of the custom fields on the backend it stops working. It will just display nothing, or display an old value.
I have no caching plugins running, and cloudflare is turned off. I am also clearing the browser cache each time.
Why is this happening?