Templates + Shortcodes + Variables
-
Hi guys,
I’ve tried this every single way I can think of – I can’t pass in a variable from Advanced Custom Fields into this shortcode.
The ACF is a URL string to a PDF document.
The shortcode which is from a plugin works fine on its own – it “embeds” the PDF into the page.But – I can’t pass the URL string into here – any ideas ????
This does not work :
$urlis = the_field('candidate_document'); $shortcode = sprintf ( '[pdf-embedder url="%1$s" toolbar="both" toolbarfixed="on" scrolltotop="on"]', $urlis ); echo do_shortcode( $shortcode );and this does not work :
echo do_shortcode( '[pdf-embedder url="' . the_field(candidate_document) . '" toolbar="both" toolbarfixed="on" scrolltotop="on"]' );I have verified that the URL output is correct – it displays the URL to the PDF.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Templates + Shortcodes + Variables’ is closed to new replies.