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">
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742267583a4412094.html
$maintitlet
and$maintitle
are two different things. – fuxia ♦ Commented Jul 13, 2020 at 4:37