Using shortcode and variable
-
Hi guys – great plugin!
I have used the do_shortcode syntax to display YouTube videos from within my theme, which successfully works, but i now want to use a variable for the video_id, but cannot seem to get it to work.
$youtube_id = the_field('new_youtube_link'); echo do_shortcode('[video_lightbox_youtube width="1280" height="720" auto_thumb="1" video_id="'.$youtube_id.'"]');
This just echo’s out the ID, with a message “Error! You must specify a value for the Video ID, Width, Height parameters to use this shortcode!”
Any ideas?
Thanks in advance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Using shortcode and variable’ is closed to new replies.