Página Inicial > wordpress > insereIframe: a simple wordpress plugin to insert iframe in posts

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).

Lincense / Lincença

GNU GENERAL PUBLIC LICENSE

Deixe seu comentário

  1. Ricardo
    16, novembro, 2009 em 19:26 | #1

    Este plugin só funciona em páginas?

    • 16, novembro, 2009 em 22:43 | #2

      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!

  2. 16, novembro, 2009 em 22:23 | #3

    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.

    • 16, novembro, 2009 em 22:42 | #4

      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!

  3. 19, novembro, 2009 em 03:39 | #5

    I have also tried it and all I see is the code. No iframe.. Please help.

  4. 25, novembro, 2009 em 21:17 | #7

    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

  5. 26, novembro, 2009 em 13:15 | #10

    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

  6. 26, novembro, 2009 em 15:52 | #11

    @wilhelm
    You can’t use spaces between ‘[‘ and ‘iframe’…

  7. 26, novembro, 2009 em 17:00 | #12

    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.

  8. 26, novembro, 2009 em 19:14 | #14

    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!

    • 27, novembro, 2009 em 09:43 | #15

      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.

  9. 14, dezembro, 2009 em 22:31 | #16

    Hi, very nice plugin.
    Can you make it work like widget with multi-instance?

    Greetings from Belgrade
    Sasa

  10. 17, dezembro, 2009 em 06:27 | #18

    I’ve try it…it works…

    Thnks…

  11. Xin
    11, janeiro, 2010 em 01:28 | #19

    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

    • 11, janeiro, 2010 em 09:57 | #20

      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,

  12. Xin
    14, janeiro, 2010 em 09:32 | #21

    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

  13. 18, janeiro, 2010 em 20:05 | #22

    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.

    • 19, janeiro, 2010 em 09:25 | #23

      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!

  14. 18, janeiro, 2010 em 20:06 | #24

    Here is the code:

  15. 20, janeiro, 2010 em 13:26 | #25

    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

  16. 20, janeiro, 2010 em 13:27 | #26

    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" >]

  17. 20, janeiro, 2010 em 13:28 | #27

  18. 20, janeiro, 2010 em 13:28 | #28

    One more time…

    !!!!!!!!

  19. 20, janeiro, 2010 em 13:30 | #29

    Maybe I can email you the code since the posts keep stripping it out?

    <!––>

  20. John
    22, janeiro, 2010 em 05:58 | #30

    Hi Wellington

    Many thanks for your WP plugin – it’s done the job nicely and simply!

    Obrigado!
    John

  21. azarimy
    22, janeiro, 2010 em 22:07 | #32

    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?

    • 23, janeiro, 2010 em 14:31 | #33

      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!

  22. 23, janeiro, 2010 em 14:16 | #34

    @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

  23. azarimy
    23, janeiro, 2010 em 22:10 | #35

    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 :D ).

    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.

    • 24, janeiro, 2010 em 01:31 | #36

      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

  24. azarimy
    24, janeiro, 2010 em 11:00 | #37

    Thanks for your advice and the links.

    I will attempt this, and if I’ve found the solution, I’ll share it with you ;) .

  25. Delfy
    17, fevereiro, 2010 em 08:13 | #38

    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"

  26. 17, fevereiro, 2010 em 22:09 | #39

    @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 ?

  1. Nenhum trackback ainda.
SEO Powered by Platinum SEO from Techblissonline