Hello. I'm working on an online archive, for which I created a custom post type and a custom field for "Files", where I uploaded a PDF for each archive item. The thing is I can't find the appropriate shortcode or block to embed it dynamically.
I have tried the Block Editor's block "File" and customising the URL by manually replacing the source with the code "[types field='item-doc]" but that renders an "a href" block and not the raw URL text.
I have not found the appropriate documentation to make my own shortcodes. I'd be interested in that, as I might face similar issues building other parts of my archive. Also I'm not too good at code yet.
In the end what I'm trying to do is to embed the PDFs dynamically. If there's an easier way I'd love to know it! But so far none of the Toolset blocks I've tried seem to be working for that purpose.
I'm using the Twenty Twenty-Five theme.
Thank you!!
Edit: This is the closest I got, but it displays what appears in the attached image
EDIT: I had a typo in my code!! I was writing "ouput". This shortcode is working just fine:
[types field='item-doc' output='raw'][/types]
Thank you!!
---
Hi Minesh!
I am actually trying to embed the PDF dynamically, not download it. I have found that I can push a custom link into WordPress' native PDF embedder, only thing is I still haven't found the correct shortcode to call for the raw url.
The code I'm actually using is this:
[types field='item-doc' output='raw'][/types]
("item-doc" being the file field I'm summoning)
and it's displaying an "a href" element with the link and the link as text:
<em><u>hidden link</u></em>
I'm looking for a shortcode to display just the URL, so I can insert it into WordPress' native PDF embedder. Like this: