How to implement an iframe with different id defined by user in front end

What I want to do is show an iframe in each page, this frame should change in every post. I need to give an id to this iframe and depends on what id I insert, it show one thing or another.

The idea is fill in some field asking for id in a kind of front end form publish this post.

<?php echo ‘<iframe style=”width: 800px; height: 178px; background: #fff; padding: 20px 20px 0 20px; margin-left: 1px;” scrolling=”auto” frameborder=”no” src=”myurl?ID=”.$new_iframe.”BGCOLOR:#FFF”></iframe>’; ?>

I need to get that new_iframe from the form in front end. In the form I created a global var.

global $new_iframe;

I created a field where I’m going to put the variable.

<div class=”col-md-3″>
<label for=”iframe_front”><?php esc_html_e(‘iframe id’,’revolution’);?></label>
<input type=”text” id=”iframe_front” name=”iframe_front” placeholder=”<?php esc_html_e(‘Escribe la ID del Iframe’,’revolution’);?>” value=”<?php echo $new_iframe;?>” class=”advanced_select form-control”>
</div>

The issues is I don’t achived to save the variable and inser it in the iframe.

What I am doing wrong?

Thanks in advance

Read more here:: How to implement an iframe with different id defined by user in front end

Leave a Reply

Your email address will not be published. Required fields are marked *