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://blog.idealmind.com.br/exemplos/plugins_wordpress/insereIframe/insereIframe_v1.5.zip
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://blog.idealmind.com.br/exemplos/plugins_wordpress/insereIframe/insereIframe_v1.5.zip
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).

Abraço!
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 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!
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
I will look into the issue and give you feedback soon!
See you!
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!
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
You can’t use spaces between ‘[‘ and ‘iframe’…
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.
By the weekend it will have been updated to work in pages too…
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!
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.
Can you make it work like widget with multi-instance?
Greetings from Belgrade
Sasa
hum… it is a great idea! But i need time to do it.. maybe next month…
see you soon!
Best regards
Thnks…
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
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,
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
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.
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 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
[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" >]
!!!!!!!!
<!––>
Many thanks for your WP plugin – it’s done the job nicely and simply!
Obrigado!
John
you’re welcome!
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?
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!
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
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.
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
I will attempt this, and if I’ve found the solution, I’ll share it with you
.
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"
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 ?
thank you for making the widget available to the community
Andrew
is there an escape or something that i can use so the brackets don’t parse.
It only does this in the ADMIN Section (wp-admin) /// regular site is fine
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!
In any case, thank you for the wonderful plugin!
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.
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
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!!
Best regards
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
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!
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
I see the iframe, but using firebug. Change the param height=”100%” to height=”500″ and you will see it.
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?
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"]
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
see http://www.w3schools.com/TAGS/tag_iframe.asp
best regards
Regards,
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
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,
This Plugin is working great. Do you have a contribute page/link where I can make a small donation?
I had not thought of using a donation button, but this is a great idea to promote my work to develop open solutions for all.
I created a PayPal donation button.
Thank you very much