Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

<iframe> code loads twice in page, not sure why

iframe, wordpress, code, php, duplication

         

snmdev

10:07 pm on Feb 23, 2017 (gmt 0)

5+ Year Member



So we have a simple WordPress template, Bridge. We are trying to embed a website using the <iframe> command, but for some reason the <iframe> duplicates.

<blockquote class="imgur-embed-pub" lang="en" data-id="a/VZE3Z"><a href="//imgur.com/VZE3Z"></a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>

Aside from the obvious formatting issue (we have not applied padding or margin), we can't seem to figure out why.

snmdev

9:13 pm on Feb 24, 2017 (gmt 0)

5+ Year Member



Hey everyone!

I have a third-party web page embedded into my WordPress using an <iframe> command. On mobile, the page inside the <iframe> tags do not resize for mobile screen sizes.

Does anyone know what additional code I can paste with my <iframe> commands in order to have the embedded website resize correctly?



[edited by: not2easy at 3:14 am (utc) on Feb 25, 2017]
[edit reason] cleanup splice msg. [/edit]

ergophobe

2:59 am on Feb 25, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not following - are you putting in an iframe or are you using javascript to affect the DOM and create an iframe?

I don't understand what the code in the blockquote is.

ergophobe

3:03 am on Feb 25, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As for the second question - I wrote an answer but the thread got joined to this one and my response to that question got lost.

So, the briefer version

1. There's nothing you can do to make the content of the iframe itself responsive except beg the site owner to do so. Security constraints prevent you from executing JS or CSS on a site you don't own.

2. You can make the iframe container responsive using JS (look up Pym I think) and CSS (look up "intrinsic ratio technique responsive iframe")