iframe - metabox wordpress show in frontend

Hello I have a metabox field called name this returns an iframe that I have placed but it returns all the code of the if

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
  • Your variable names don't match: $maintitlet and $maintitle are two different things. – fuxia Commented Jul 13, 2020 at 4:37
Add a comment  | 

1 Answer 1

Reset to default 1

The 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">

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742267583a4412094.html

相关推荐

  • iframe - metabox wordpress show in frontend

    Hello I have a metabox field called name this returns an iframe that I have placed but it returns all the code of the if

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信