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://www.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://www.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://www.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://www.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 ?