Tagged: x
-
AuthorPosts
-
October 10, 2016 at 6:55 am #1209802
jmacreationsParticipantI am designing a custom page template using ACF and hoping to be able to embed a youtube video with the [x_video_embed] shortcode. Using an ACF field for the URL part of the shortcode. I currently have this:
<?php if( get_field('video_link')) { $videoURL = get_field( "video_link" ); $videoShortcode = '[x_video_embed]<iframe width="1280" height="720" src="'.$videoURL.'" frameborder="0" allowfullscreen></iframe>[/x_video_embed]'; echo do_shortcode( $videoShortcode ); }?>The code works fine if i don’t use the variable. It’s only when i use the variable does it not work. When I echo the value of the variable to the page, it is exactly what i want in the src=”” section.
I have tried many solutions and wondering why this is not working. Any help would be greatly appreciated. Even a completely different way of embedding a video from a YouTube URL.
October 10, 2016 at 7:19 am #1209830
jmacreationsParticipantSOLVED!
replace the $videoShortcode line with:
$videoShortcode = '[video width="1280" height="720" src="'.$videoURL.'"]';For some reason the [x_video_embed] shortcode does not work well. Maybe because it has opening and closing parts?
I hope this helps someone in the future – maybe devs have a different solution that uses the x shortcode?
October 10, 2016 at 8:36 am #1209919
ChristianModeratorGlad you’ve sorted it out and thanks for sharing. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1209802 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
