WP SITES

3086 Coded Tutorials & 290 Plugins

7 Ways To Code a PDF File Added To a Custom Field

This post contains 7 different solutions which enable you to:

  1. Open a PDF file in the same window
  2. Check if the custom field value field is empty
  3. Link to the full file URL
  4. Link to title text
  5. Link to a icon
  6. Open a file in a new window
  7. Add button & open PDF using printf

All solutions assume you have added a URL for your file to the custom field value field or any plugin field which generates meta boxes like ACF.

custom_fields

Here’s the code for all 7 solutions, all coded differently:

More Custom Fields Code

Leave a Reply

New Plugins