Problem:
I want to display a list of PDF attachments that have been uploaded and inserted into the body of a post. However, in the Views interface, "attachment" is not available as a post type, making it unclear whether this can be done visually or if custom PHP is required.
Solution:
Toolset does not currently support attachments in the Views GUI. Instead, use custom PHP with get_posts() to retrieve attachments with post_type='attachment' and post_mime_type='application/pdf', filtering by post_parent to match the current post. Then, use a shortcode to display the list of PDFs below the post content.
Relevant Documentation:
https://toolset.com/forums/topic/question-about-listing-post-attachments/#post-2795046
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
This topic contains 1 reply, has 1 voice.
Last updated by 4 months, 1 week ago.
Assisted by: Christopher Amirian.