File

The File field allows a file to be uploaded and selected by using the native WP media popup.

How to use it

Select the File field from your field group.

Fill out a label for the file in the Label field. This text will be prepended to the field. e.g. PDF Download: file-name.pdf

The Link Label is useful when you want to have more consistency in the output, fill out the Link Label to replace the link text of your file. By default the File name from the file attachment is used.

Displaying detailed into (Pro)

By default, the File field is displayed as a link, which suits most use cases. However, in some instances, you might want to display detailed information about the file. For example, if you've created a file field where a video has been selected, you may want to display it as a video player.

All WordPress media items, including images and files (videos, PDFs), belong to the 'attachment' post type. This means you can use any standard post fields.

Here’s how to do it:

  1. Create a Separate View for the File Display: Set up a new View specifically for the File display, selecting the appropriate fields (e.g., Post -> Attachment video), and save it.

  2. Choose the View for the File Field: Select the newly created View in the View field of your File field settings, similar to how you would for any object field.

That’s it! Your video will now be displayed with a video player. This approach can be used to display any post information, such as the author, updated date, etc.

Last updated