嵌入iframe的wordpress短代码每页只执行一次
我有以下wordpress短代码嵌入iframe的wordpress短代码每页只执行一次,wordpress,iframe,shortcode,Wordpress,Iframe,Shortcode,我有以下wordpress短代码 function wiki_show( $atts ) { // Attributes $atts = shortcode_atts( array( 'name' => '', 'height' => '500', ), $atts, 'wiki' ); // Return custom embed c
function wiki_show( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'name' => '',
'height' => '500',
),
$atts,
'wiki'
);
// Return custom embed code
return '<div><iframe src="https://en.wikipedia.org/wiki/' . '&name=' . $atts['name'] . '" height="' . $atts['height'] . '"/></div> ';
}
add_shortcode( 'wiki', 'wiki_show' );
问题是,在第一个iframe之后,没有显示任何内容(甚至在第一个iframe之后的BBBB…)
如果我将短码代码改为标记一些“foo”而不是“iframe”,它将正确显示所有代码
如果我手动嵌入2个iframe(没有短代码),效果很好
如何使快捷码工作?我做错了什么
(*学分:此代码改编自:)元素。你应该把它改成
return '<div><iframe […]></iframe></div>';
返回“”;
还可以查看HTML验证程序,它会发现这个问题。;-) 元素。你应该把它改成
return '<div><iframe […]></iframe></div>';
返回“”;
还可以查看HTML验证程序,它会发现这个问题。;-)