1
我有一個簡碼專門爲YouTube添加嵌入了寫像這樣:YouTube添加參數到簡碼的iframe嵌入
// [iframe src="" scrolling="no" class="dynamicIframe" allowfullscreen="" style=""]
add_shortcode('iframe', 'anc_shortcode_iframe');
function anc_shortcode_iframe($atts, $content = null) {
extract(shortcode_atts(array(
'src' => '',
'scrolling' => '',
'class' => '',
'allowfullscreen' => '',
'style' => ''
), $atts));
return '<iframe src="' . $src . '"' . ($scrolling ? ' scrolling="' . $scrolling . '"' : '') . ($class ? ' class="' . $class . '"' : '') . ($allowfullscreen ? ' allowfullscreen="' . $allowfullscreen . '"' : '') . ($style ? ' style="' . $style . '"' : '') . '></iframe>';
}
我想在添加一些默認參數的所有影片,而且無法似乎使它工作。喜歡的東西
?rel=0&list=youtubeplaylistid
您是否對每個視頻都有相同的YouTube播放列表ID,或者是否要分別在每個短代碼中定義播放列表ID? – pomaaa
整個網站的播放列表ID可以相同。 – Clare