Create download link for file/image/video
-
I’d be very grateful if someone could help me find a solution to a problem. For each “Course” (my custom post type), I want to be able to show the title, description, custom fields, and a link to the PDF that I have for each course. ‘m using WP 6.2 and Pods Version 2.9.13, using the Twenty Twenty Three theme. I’m developing locally, so can’t share the link to my site.
I’ve created a custom post type and custom fields. The custom post type is “Course”; the custom field, a “file/image/video” field, is called “Syllabus”. I have PDF files for each of the custom posts — so, for instance, I have a post entitled “Modern European History,” and I have attached a PDF called “MEHSyllabus.pdf” to the custom field. (The MEHSyllabus file is now in the Media library.)
What I want is to have a button for each course that allows the users to click to download the pdf. I have tried several ways to do this, but have run into a brick wall. (I don’t know if the brick wall is there because of my ignorance or because this is more complicated than it initially appears.)
First try: placed a “Pods Field Value” on the single course template, choosing “course” as the Pods type, leaving the “Slug or id” box as the default, and “syllabus” as the field name. It returns the url for the field, but it’s not “clickable”.
Second try: placed a “Post Single Item” block on my sink, with a template: <div>{@post_title}</div>
<div>{@}</div>I get the post title and the proper url — but again, not clickable.
It feels like I’m *close* to a solution, but… not there. Can someone point me in the right direction?
Thank you in advance,
André
- The topic ‘Create download link for file/image/video’ is closed to new replies.