admin管理员组文章数量:1330628
Hello I have a metabox field called name this returns an iframe that I have placed but it returns all the code of the iframe and it was not executed. What is missing in my code to show it in the frontend?
$maintitlet = get_post_meta( get_the_ID(), 'name', true );
echo $maintitle;
show the code. I have put that space because it did not allow me to publish the code iframe
<iframe src="link.html" width="670" height="500"></iframe>
Hello I have a metabox field called name this returns an iframe that I have placed but it returns all the code of the iframe and it was not executed. What is missing in my code to show it in the frontend?
$maintitlet = get_post_meta( get_the_ID(), 'name', true );
echo $maintitle;
show the code. I have put that space because it did not allow me to publish the code iframe
<iframe src="link.html" width="670" height="500"></iframe>
Share
Improve this question
edited Jul 13, 2020 at 4:36
fuxia♦
107k38 gold badges255 silver badges459 bronze badges
asked Jul 12, 2020 at 19:35
StymarkStymark
372 bronze badges
1
|
1 Answer
Reset to default 1The output is escaped, so it will not display html, try this :
just save the value of the src attribute
<iframe src="<?php echo esc_attr__( get_post_meta( get_the_ID(), 'name', true ) ); ?>" width="670" height="500">
本文标签: iframemetabox wordpress show in frontend
版权声明:本文标题:iframe - metabox wordpress show in frontend 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742267583a2443700.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
$maintitlet
and$maintitle
are two different things. – fuxia ♦ Commented Jul 13, 2020 at 4:37