On November 17, 2014 at 4:54 pm
No. its not that. the playlist requires different code. Open up shortcodes.php and replace this:
function thn_youtube_func($atts, $content) {
//extract short code attr
extract(shortcode_atts(array(
'width' => '100%',
'height' => '100%',
'autoplay' => 'true',
), $atts));
$content = strip_tags($content);
$content =str_replace('http://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $content);
$content =str_replace('https://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $content);
if ($autoplay == 'true'){
$autoplay= 1;
}elseif ($autoplay == 'false'){
$autoplay= 0;
}
$return_html = '<div style="clear:both;"></div><div class="ast_vid"><div class="responsive-container"><iframe class="vid_iframe" style=" width: '.$width.'; height: '.$height.';" src="'.$content.'?autoplay='.$autoplay.'" allowfullscreen></iframe></div></div>';
return $return_html;
}
add_shortcode('youtube', 'thn_youtube_func');
with this:
function thn_youtube_func($atts, $content) {
//extract short code attr
extract(shortcode_atts(array(
'width' => '100%',
'height' => '100%',
'autoplay' => 'true',
), $atts));
$content = strip_tags($content);
if (($pos = strpos($content, "list=")) !== FALSE) {
$listid = substr($content, $pos+5);
$content ='//www.youtube.com/embed/videoseries?list='. $listid;
}else{
$content =str_replace('http://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $content);
$content =str_replace('https://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $content);
}
if ($autoplay == 'true'){
$autoplay= '?autoplay=1';
}elseif ($autoplay == 'false'){
$autoplay= '';
}
$return_html = '<div style="clear:both;"></div><div class="ast_vid"><div class="responsive-container"><iframe class="vid_iframe" style=" width: '.$width.'; height: '.$height.';" src="'.$content.''.$autoplay.'" allowfullscreen></iframe></div></div>';
return $return_html;
}
add_shortcode('youtube', 'thn_youtube_func');
let me know.
Thanks