Post Grid: Retrieving Custom Field / Meta Key for a custom ‘File’ Field.

Post Grid: Retrieving Custom Field / Meta Key for a custom ‘File’ Field.

By jojo on July 11, 2018

jojo
Jul 11, 2018 10:50 PM 1 Answers General
Member Since Jul 2018
Subscribed Subscribe Not subscribe
Flag(0)
Hello, • I'm using the pro version of 'Post Grid'. • Using ACF, I have added a custom 'file' field to my custom post type ("Resources"). For this custom field in ACF, I have chosen to return the value of the file's URL (not 'File Object' or 'File ID'). • When displaying my posts with Post Grid, I can only seem to pull the file's ID. I have tested with a simple custom text field, and it displays alright, but I need to keep it as a 'file' selection field to keep things easier for the user Thanks for any help!  
2 Subscribers
Submit Answer
Please login to submit answer.

1 Answers
Sort By:
Best Answer
0
PickPlugins
Jul 11, 2018
Flag(0)

Welcome to our forum.

I understand your issue, In this case i would like to suggest you to create a shortcode  for the expected output and you can use that shortcode by HTML element on layout editor

View post on imgur.com

You can get access to post id by following functions.

get_the_id();

I hope this way you can display better way than meta key field.

I hope you understand.

Please let me know if you need more help.

Regards

jojo
- Jul 11, 2018 11:56 PM
Flag (0)
0

Thank you, though I am still a little confused about the process to do this. What would be the process for creating a shortcode for the output?

Will 'Post Grid' not work with 'Advanced Custom Fields' directly? It seems odd to me that it works for some ACF content, but not for the 'file' field type.

jojo
- Jul 12, 2018 12:07 AM
Flag (0)
0

To further clarify, I tried using the 'html' approach you mention, using an entry of: [acf field="resource_file_url"]

This, however, returns not only the URL, instead outputting: ID, file name, file type, , , file URL.

jojo
- Jul 12, 2018 01:26 AM
Flag (0)
0

Success! After republishing my posts, things seem to work. Thank you!

1+ more comments. Sign in to Reply
Replying as Submit