ACF fields not outputting the value on frontend

Hello Ketan,

Using {{dc:acf:post_field field="pdf_attchment_for_blog"}}, you should be able to get the PDF file. If you are trying to display the PDF file itself, WordPress does not do that. You will have to install a PDF viewer plugin to be able to do so.

Best Regards.

Hey, Thanks for your help.
No I’m not displaying any pdf on frontend. I just want to display an icon of download if the pdf is being attached with the post.
To attach the pdf with the post I’ve used the file type field of ACF plugin. So I just need if the file is attached with any of the post than that post will show the download icon on front-end, if not contains any pdf than the icon will be hidden. So that when user clicks on the download icon it will be download the attach pdf and this is the default functionality of attaching any file. and it is working too. I just want to know how to hide/show download icon on the posts with or without any pdf being attched with the any post.

Hello Ketan,

You will just have to use the String condition added to the Icon element:
{{dc:acf:post_field field="pdf_attchment_for_blog"}} is not blank.

Best Regards.

1 Like

Hey, Thanks you for this help. Now it is working as my need.

Hey Ketan,

You’re most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.