ACF file URL postmeta field not working
I'm trying to create a button and use the postmeta field to populate the url of the file I want it to link to, but it is not working. It is returning the value 0.0.0.173 instead of the URL when clicking the button.
In ACF I have created the field type file and set the return value as URL. The file I'm uploading is a PDF and I have it set to allow all file types.
Comments
Hi,
Please send us the WordPress dashboard and FTP access privately thru the contact form, which is on the right side at [Links visible only for registered users] and we will check what might be the reason.
Notice!
Please attach a link to this forum discussion.
Sending incorrect or incomplete data will result in a longer response time.
Therefore, please ensure that the data you send are complete and correct.
Thanks
I've emailed through the envato messaging system. Awaiting your reply.
Thanks! We just found where the problem was.
So, postmeta:{id} works for simple values (like text or number, for example) and in most cases it will also work with acf, but when the returned value is modified by acf, you need to use acf:{id} instead which passes the value through the acf function.
Therefore, in this case, you should use {acf:floor_plan_pdf} instead od {postmeta:floor_plan_pdf}
Thank you! That works now!
You're welcome :) Happy to help!
On a related note. It would be beneficial if we could sort the query loop by any of the acf fields. In this instance, if I could create loops that sort the floor plans by square footage from least to most, or number of bedrooms, etc it would be nice. That would give you many more options for displaying the posts.
Thanks for suggestion, we will consider it in future updates for sure.