insereIframe: a simple wordpress plugin to insert iframe in posts
English
A simple way to insert iframes in your wordpress posts
How to install
Download http://wordpress.org/extend/plugins/insere-iframe/
Unzip the file to your /wp-content/plugins/ directory
Activate plugin
Usage
To insert an iframe in your post, insert the code below in the place that you want the iframe (without spaces between [ and iframe: ):
[ iframe: src="http://www.example.com" frameborder="0" width="100%" height="200" scrolling="no"]
You can set any attribute that you want (see a list of possible attribues in http://www.w3schools.com/TAGS/tag_iframe.asp).
Enjoy!
Português
Uma forma muito fácil de inserir iframes nos seus posts do wordpress
Como instalar
Faça o download em http://wordpress.org/extend/plugins/insere-iframe/
Descompacte o arquivo na pasta /wp-content/plugins/
Ative o plugin pelo wordpress
Como usar
Para inserir um ifame em seu post, no local em que você quer que o iframe apareça, insira o código como no exemplo abaixo (sem espaços entre [ e iframe: ):
[ iframe: src="http://www.exemplo.com" frameborder="0" width="100%" height="200" scrolling="no"]
Usando esse plugin, você pode usar todos os atributos de um iframe (veja http://www.w3schools.com/TAGS/tag_iframe.asp).

Este plugin só funciona em páginas?
Atualmente não funciona em páginas, mas somente em posts. Em breve vou fazer uma atualização para funcionar em páginas também.
Abraço!
In WordPress 2.8.6, I tried your plugin and it doesn't insert the iframe, just displays the code as text. I have [iframe: src="http://www.google.com/calendar/hosted/gci.org/embed?src=gci.org_rqhl5tddnbi8fjt6620je79ns0%40group.calendar.google.com&ctz=America/Los_Angeles" width="800" height="600" frameborder="0" scrolling="no"] as the code.
Hi Bret!
I did a test and it works with your attributes…
I used
[iframe: src="http://www.google.com/calendar/hosted/gci.org/embed?src=gci.org_rqhl5tddnbi8fjt6620je79ns0%40group.calendar.google.com&ctz=America/Los_Angeles" width="800" height="600" frameborder="0" scrolling="no"]
Can i see were you have tried to insert it?
thanks!
I have also tried it and all I see is the code. No iframe.. Please help.
Hi Chris!
I made a path to test the plugin in my blog. You can see it working at:
http://blog.idealmind.com.br/php/graficos-em-php-e-flash/
(there is a flash chart inserted by an iframe using the Insere Iframe plugin).
To disable the action of the plugin, you can access the same url, with the parameter ?disableinsereiframe at the end, then, you can see the code that insert the iframe when the plugin is enabled (in the same place where you saw the flash chart). The complete url is http://blog.idealmind.com.br/php/graficos-em-php-e-flash/?disableinsereiframe
I think that this example will be helpfull to you.
Remember that if you are trying to insert an iframe in a page, the plugin will not work. It works only in posts.
See you!
Hi Wellington!
I’m using WP 2.8.6. Activating insereIframe I get the message:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /mnt/web5/53/16/5920416/htdocs/wp-content/plugins/insere-iframe/insereIframe.php on line 15
I tried both versions, 1.0 and Development.
Greetings from Berlin
Wilhelm
Hi Wilhelm!
I will look into the issue and give you feedback soon!
See you!
Hi again wilhelm!
Well, you are trying run the InsereIframe plugin into PHP 4. The plugin is Object-Oriented Programming (OOP), then it works only in PHP 5+.
I’ve just made an version for PHP 4:
In plugin section of wordpress panel, you can edit the plugin, replacing the content of insereIframe.php with the content of http://blog.idealmind.com.br/exemplos/plugins_wordpress/insereIframe/insereIframe.txt
Greetings from Rio de Janeiro!
Hi Wellington!
Thanks a lot. It’s PHP 4.4.9. After editing activation was fine.
But using the plugin (as Chris above) I only get the code, for example:
[ iframe: src="http://www.schachfieber.de/inline/20091125mousetrapper1.htm" width="100%" height="390" frameborder="0" scrolling="no"]
Therefore – for the moment – I have to return to my former solution.
Best wishes
Wilhelm
@wilhelm
You can’t use spaces between ‘[‘ and ‘iframe’…
I like the plugin, only 1 problem, it only works on new posts and nog on new pages.
when i use the code on a new page then i see the code.
when i use it whitin a post it works great.
So i wait for an update so it works on pages and new pages too. till then its de-activated.
Hi Mark!
By the weekend it will have been updated to work in pages too…
For those who just can’t wait:
Plugin directory, insereIframe.php, line 37. Change it to:
if( ( is_single() || is_home() || is_page()) && !is_feed() )
Other than that, nice, clean and usable plugin, Wellington. Thank you very much!
Thanks Matthias!
The plugin was updated to work in pages too…
Any suggestion to update the plugin and to do it more useful, please let a comment or send me an e-mail.
Hi, very nice plugin.
Can you make it work like widget with multi-instance?
Greetings from Belgrade
Sasa
Thanks sasa!
hum… it is a great idea! But i need time to do it.. maybe next month…
see you soon!
Best regards
I’ve try it…it works…
Thnks…
Hi Wellington,
Thanks for the plugin. I have problems.
I am using PHP 4.3.9, and I updated the php file with http://blog.idealmind.com.br/exemplos/plugins_wordpress/insereIframe/insereIframe.txt and activated OK.
But when I put
[iframe: src="http://www.controlite.co.il/default.asp" width="800" height="600" frameborder="0" scrolling="no"]
into a page and only display the code.
http://www.danpalon.info/controlite/
Can you help? Thanks.
b.tw: my wordpress is 2.8
Thanks,
xin
Hey Xin!
I take a test using the same code that you, [iframe: src="http://www.controlite.co.il/default.asp" width="800" height="600" frameborder="0" scrolling="no"], and it works fine…
The link that you send me it’s working… are you still using the insereIframe plugin?
Best regards,
Hi Wellington,
Thanks a lot for your reply. Not sure why is not working on my Server, Maybe related to WP version or maybe the Server settings. The working one is using html iframe tag, sorry, my mistake. I will give it a go with WP2.9. Thanks again for your great work!
xin
I am using wordpress and I installed your plugin. Since this is the first time I am using it, I can’t be sure if it is working properly. When I upgraded automatically inside wordpress, I see this error:
Plugin failed to reactivate due to a fatal error.
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /webroot/d/e/democ001/primary/www/wp-content/plugins/insere-iframe/insereIframe.php on line 15
Even if I edit the plugin and add the code from one of the comments above (and it activates properly), the following code does not seem to work. If you have a moment to lend a hand to this, I would be honored.
Thank you.
Hi Nathan!
The first error ocurred cause you are using an older version of php (like php 4).
Now, with the correct version of InsereIframe plugin, i think that it will work. It seems that you are not putting the correct code to insert the iframe.
Try use the code below:
[iframe: src="http://www.eventbrite.com/r/ecal" width="800" height="600" frameborder="0" scrolling="no"]
Personalize with your oun atributes.
Best regards!
Here is the code:
Thank you for writing back…I am getting closer…I also realize your product is free, but I really want to make this work. Would you mind looking at this code one more time and lead me to the answer or show me???
Here is the code that Eventbrite is giving me to use with their widget. What do I need to do to make this work with your iframe software in a Post? I put the brackets in so that the code would show up in this post. I realize they don’t belong there in the post.
{{{{{{{}}}}}
Thank you for your help on this…Nathan
Darn…here is is again:
[iframe name="countdown" id="mgframe" src="http://www.eventbrite.com/countdown-widget?eid=379061784" width="250" height="338" marginheight="0" marginwidth="0" scrolling="no" frameborder="0" >]
““
One more time…
!!!!!!!!
Maybe I can email you the code since the posts keep stripping it out?
<!––>
Hi Wellington
Many thanks for your WP plugin – it’s done the job nicely and simply!
Obrigado!
John
Hey John!
you’re welcome!
Hi Wellington,
I’m trying to get this to work with dynamic heights. I want to show a forum in the iframe, but i can’t get the heights to work dynamically. Do you have any suggestion to work around this?
Hi azarimy!
You can insert a javascript function in the content of you post/page, and in the code of insertIframe, put a javascript atribute that runs the function.
Try to do this:
[ iframe: src=”http://www.example.com” width=”100%” height=”340″ scrolling=”no” frameborder=”0″ id=”dynamic_iframe” onLoad=”resizeIframe();”
< script type=”text/javascript” >
// Firefox worked fine. Internet Explorer shows scrollbar because of frameborder
function resizeFrame() {
document.getElementById(“dynamic_iframe”).style.height = document.getElementById(“dynamic_iframe”).contentWindow.document.body.scrollHeight + “px”;
}
< /script >
Best regards!
@Nathan
the code you send me is wrong!
[iframe name="countdown" id="mgframe" src="http://www.eventbrite.com/countdown-widget?eid=379061784" width="250" height="338" marginheight="0" marginwidth="0" scrolling="no" frameborder="0" >]
you have an error in the last two characters ” >] “. Try to use only ” ] ” without ” > “.
Best regards
Hello again, Wellington. Thanks for the assist.
However, I still could not get it to work. I’m not very well versed in programming, so please excuse my lack of understanding. I checked your code, and saw a few issues.
i. I assume you forgot to close the iframe bracket.
).
ii. The function name is different from the onLoad thingy (not sure what to call it
I copy and pasted your codes into the html of a WP Page. I’ve adjusted the two issues above and deleted the spaces between the brackets. But I still couldn’t get it to work. Perhaps I am missing something?
For reference:
WordPress Page I’m working on: http://www.tanggam.com/v4/?page_id=74
Forum I want the iFrame to view on: http://www.tanggam.com/v3/forum/
Another question:
Will the height readjust itself every time I click on a link inside the iFrame? If it doesn’t perhaps this is more complex than I imagined.
I really appreciate your time in this.
Hey azarimy.
Thanks for your corrections in the code.
I’m sorry, but i have few time to think about your question…
If you want that the iframe height adjust itself every time you click on a link inside it, you have to put a javascript code inside the forum, that will run another javascript function in the parent page.
In a google search, i found this site that i hope it will be useful for you: http://www.pixelmedia.com/blog/dynamic-iframe-height/
But to do so, you may have to edit the WP template to add jquery script.
Best regards
Thanks for your advice and the links.
I will attempt this, and if I’ve found the solution, I’ll share it with you
.
My private installation is on MyPrivateIP
I’m creating a new page and if I use
[iframe: src="http://www.google.com" frameborder="0" width="100%" height="200" scrolling="no"]
it works but if I use
[iframe: src="http://MyPrivateIP/wordpress/mydocs/index.html" width="100%" height="200" scrolling="yes"]
I’ve a problem, this is the error:
“Not Found
The requested URL /wordpress/<a href= was not found on this server.
Apache/2.2.8 (Ubuntu) mod_python/3.3.1 Python/2.5.2 PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g mod_perl/2.0.3 Perl/v5.8.8 Server at MyPrivateIP Port 80"
@Wellington Ribeiro
Hi, I have the exact same problem as everyone else. Only the code is displayed. I checked the syntax its 100% correct. I am trying this on a post not a page.
WP 2.9.2 PHP 5.x
Did anyone ever resolve this problem ?
It really not work.. SHIT PLUGIN
you that don’t know how to use it.
There is more elagant solution without using plugins. I use it on my site and it’s worked well. http://www.vividvisions.com/2009/02/11/wordpress-add-iframes-to-your-post/
Was hoping that 2.9 would solve this but no luck – was very happy to find your page.
thank you for making the widget available to the community
Andrew
Upgrade to v. 1.3 broke the plugin on my site – now the page shows only the shortcode. Can you share what changed and why so I can fix? For now I am downgrading back to version 1.1. Thanks!
I did an automatic upgrade (v1.3) when I tried to go back to the dashboard after this was reactivate, my admin section was broken. Now all I get is this “” …. PLEASE HELP!
It only does this in the ADMIN Section (wp-admin) /// regular site is fine
The plugin was updated to solve the reletaed bug. Thank you!
I don’t think that worked, as it was the only thing on my site that was edited in the last 4 days. Everything else was working when I did the last edits on Friday Afternoon. Is there any more solutions to get this to work
The 1.4 update still doesn’t work. Not sure what change, but it’s busted now.
Hey DFW.
well, the plugin only works in posts and home.
You can see:
http://blog.idealmind.com.br/tag/grafico-em-php-e-flash/ <== Tag results
and
http://blog.idealmind.com.br/php/graficos-em-php-e-flash/ <== Post
On tag results, it doesn't work, but in post, it works fine (you will see a flah chart).
You can edit the plugin and insert ' && is_tag()' , in condition
if( ( is_single() || is_home() ) && !is_feed() )
to solve this problem.
See http://codex.wordpress.org/Conditional_Tags
Or you can remove the if condition, and the plugin will work in any content, by modifying the function insereIframe( $content ):
function insereIframe( $content ) { return InsereIframe::substituiIframe( $content ); }Best regards!
I see from the above comment that I will need to edit the plugin to make it work on Pages. Yet, it used to work on Pages in version 1.1. Is there a reason you removed this feature in the latest version of the plugin? It’s making it difficult to upgrade because a lot of my client sites use this on Pages.
In any case, thank you for the wonderful plugin!
why do you need a plugin for a simple iframe? Just use this code and post as HTML..
If you can see this, your browser doesn’t
understand IFRAME. However, we’ll still
link
you to the file.
If you can see this, your browser doesn't
understand IFRAME. However, we'll still
link
you to the file.
Hi Wellington
you made a nice job with this plug-in.
Just to remind people that they have to create an excerpt, it will display the code if not !
Thanks again
Muito bom o plugin, resolveu meu problema. Muito obrigado!
Wellington.. I just found and installed the insere iframe plugin .. Kudos for this plugin. We’ve been needing a clean way to put iframe references into WP. Now I have a question for you.
The page on which I’m use your plugin is a Password Protected WP PAGE (not a Post). In the initial testing, the PAGE loaded in Password Entry mode just fine. But now I cannot get it to remain ‘hidden’. Linking from the WP Page Header renders a ‘full-open’ version of the page – no Password required! Not what I need.
I have turned off all Password saving elements on the browsers (Firefox and GoogleChrome) and have flushed all cache. Closed out URLs and shut browser down.
Still the page comes up unprotected.
I even deactivated the insere iframe plugin. The page still comes up unprotected.
Are you aware of any code from your plugin that would render the password protection null..?
Thanks for the assist.
Other than this the insere iframe plugin is a fabulous!!
The code of insereIframe plugin is very simple and short… I really don’t believe that the insereIframe plugin is causing the pass problem, especially because you turned it off, and the issue remained. You can also try to uninstall it.
Best regards
I am still trying to get my iframe to adjust the height dynamically in WordPress – I tried all the suggestions listed here – but none seem to work. Have you found any new solutions? Thanks for the plugin!
Dear Sir:
Just installed Insere Iframe 1.5 plugin in our WP3MS, BP 1.2.5 installation. After creatin a page and include [iframe: src="http://www.webpage.com" width="100%" height="100%" scrolling="no" frameborder="0"], frame is not showing correnctly. Height value is assumed as 100 px.
How we fix this ?
Regardsm
Hi!
I did an upgrade on my blog to version 3 of WP, and I didn’t find any problem. Be sure that you inserted the code correctly.
Best regards!
Dear Sir:
Please visit the website page included. The code we insert is:
[iframe: src="http://www.website.com" width="100%" height="100%" scrolling="no" frameborder="0"]
Regards,
@Wellington Ribeiro
Hi!
I see the iframe, but using firebug. Change the param height=”100%” to height=”500″ and you will see it.
Hi,
Thanks a lot for the plugin. This seems to be the only one that works.
A reason why lot of people are complaining is because they are copying the ‘usage’ code present right at the top of this page. That code has an error. There is an extra space between the opening square bracket and iframe: keyword.
As a result of the space, WP Editor automatically encloses the code in SPAN tags and hence the iframe shows up as code in post.
Can you fix this please?
Hi, your plugin is the closest to working so far, BUT, the result is the page loads as complete redirect!
When I used
[iframe: src="http://www.google.com" frameborder="0" width="100%" height="500" scrolling="yes"] Google displayed perfectly in the iframe.
This is the code that is REDIRECTING
[iframe: src="http://madill.promocan.com/Products.htm" frameborder="0" width="100%" height="500" scrolling="yes"]
I don’t know why this happens.
Try another page…
if it does not work only with http://madill.promocan.com/Products.htm, it can be because the server refuse external iframes (I don’t know if it is possible, it’s a hypothesis)
Regards
@Wellington Ribeiro If we use – height=”500″ – as you suggest and our calendar listing exceed this height, will it automacally adjust, or should be use schroll ?
try using scrolling=”yes”
see http://www.w3schools.com/TAGS/tag_iframe.asp
best regards
@Wellington Ribeiro Dear Mr. Ribeiro: Thanks for your reply, as see on the link sent, height=”100%” should work, and it isn’t with your plugin, is there a way to fix this ?
Regards,
Wellington,
I think you hit the nail on the head! THANKS
The site I was trying to frame breaks out of theme! I was going insane trying to figure this out!!
Be Awesome!
John Cussons
Dear Sir:
We recently found another issue, [iframe: src="http://www.website.com/events/switchLang.php?l=german" width="100%" height="100%" scrolling="no" frameborder="0"] where website.com is our websu¡ite url indicated in our profile.
The issue is that when page load it enter in a continue loop without end.
To see what´s happening please visit http://www.website,com/agenda, where website.com is our websu¡ite url indicated in our profile.
Hope to receive your help.
Regrads,