How to construct a do_shortcode that works?
-
Hi,
I am trying to construct a do_shortcode so that I can display a PDF … but whatever I try I seem to get errors from, I think, pdf embedder saying that the PDF is missing.
I have seen the other topic “Missing PDF” but that didn’t help.I am adding a Shortcode field to a single post template in Elementor.
the code is very simple.$mediaurl = 'https://mysite/wp-content/uploads/2021/05/Sample.pdf'; echo do_shortcode( ' [ pdf-embedder url=$mediaurl ] ' );
But the error reports
missing PDF "https://mysite/documents/670/$mediaurl"
I have tried numerous different combinations of quotes and doublequoates but no improvement.
So How do I actually call pdf-embedder in the shortcode?
Why is the error reporting a missing PDF based off the url of the template itself rather than the actual media url?Thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to construct a do_shortcode that works?’ is closed to new replies.