iframe

iframedonateview source

WordPress iframe plugin

WordPress plugin: embed iframe into content.

Iframes are needed to embed video from youtube or to embed Google Map or just to embed content from external page.
WordPress removes iframe when you switch from "HTML" to "Visual" tab because of the security reasons.
So you can embed iframe code using this shortcode [iframe width="100%" height="480" src="http://player.vimeo.com/video/3261363"].

You also can use this shortcode to embed content via simple link: [embed_]http://www.youtube.com/watch?v=A3PDXmYoF5U[/embed] (without underscore '_')
shortcode is a WordPress core feature and based on oEmbed.

Parameters:

  • src - source of the iframe [iframe src="http://player.vimeo.com/video/819138"] (by default src="http://player.vimeo.com/video/819138");
  • width - width in pixels or in percents [iframe width="100%" src="http://player.vimeo.com/video/819138"] or [iframe width="640" src="http://player.vimeo.com/video/819138"] (by default width="100%");
  • height - height in pixels [iframe height="480" src="http://player.vimeo.com/video/819138"] (by default height="480");
  • scrolling - parameter [iframe scrolling="yes"] (by default scrolling="no");
  • frameborder - parameter [iframe frameborder="0"] (by default frameborder="0");
  • marginheight - parameter [iframe marginheight="0"] (removed by default);
  • marginwidth - parameter [iframe marginwidth="0"] (removed by default);
  • allowtransparency - allows to set transparency of the iframe [iframe allowtransparency="true"] (removed by default);
  • id - allows to add the id of the iframe [iframe id="my-id"] (removed by default);
  • class - allows to add the class of the iframe [iframe class="my-class"] (by default class="iframe-class");
  • style - allows to add the css styles of the iframe [iframe style="margin-left:-30px;"] (removed by default);
  • same_height_as - allows to set the height of iframe same as target element [iframe same_height_as="body"], [iframe same_height_as="div.sidebar"], [iframe same_height_as="div#content"], [iframe same_height_as="window"] - iframe will have the height of the viewport (visible area), [iframe same_height_as="document"] - iframe will have the height of the document, [iframe same_height_as="content"] - auto-height feature, so the height of the iframe will be the same as embedded content. [same_height_as="content"] works only with the same domain and subdomain. Will not work if you want to embed page "sub.site.com" on page "site.com". (removed by default);
  • any_other_param - allows to add new parameter of the iframe [iframe any_other_param="any_value"];
  • any_other_empty_param - allows to add new empty parameter of the iframe (like "allowfullscreen" on youtube) [iframe any_other_empty_param=""];

221 comments on “iframe

    • webvitaly Post author

      You have an error in the shortcode.
      Try this one: [iframe src="http://pinterest.com/chris"]

  1. Pingback: New iFrame Plugin » Portal Net Documentation

    • webvitaly Post author

      Try this shortcode: [iframe src="src="http://63.246.128.80/a2billing/customer/"]

  2. hello, ive set up an iframe with a pdf document for our intranet site.

    in chrome my wordpress menu goes over the iframe windows perfect but for ie9 it falls behind it.

    i tried differend z-indexes with both position relative and absolute without a resolve.... the content is within borders even if i set the width and height smaller it keeps bugging. is there any command of fix for this ?

    • webvitaly Post author

      sorry, but IMHO you will not fix it.
      it is the problem of IE.
      you may encourage users to use modern browsers, which updates more often than IE.

  3. I have been trying to embed a page with a form into our corporate WordPress page. The resulting form works for most people. Not for others. It either submits and progresses to the success page or throws an error. I can reproduce the error in Chrome and Firefox on Mac. The frustrating thing is that the form works every time on the source page but not when embedded in an iframe on ours.

  4. I'm using Iframe, and working good with most pages.

    Now I'm trying to get google.com/finance to display with Iframe on my site but not luck, any suggestions?

    Thanks.

    • webvitaly Post author

      Google blocked iframe embedding via iframe for google.com/finance.
      Google-finance return such headers:
      x-content-type-options:nosniff
      x-frame-options:SAMEORIGIN
      x-xss-protection:1; mode=block

  5. I want to use the iframe and i want to make sure only partial of the website that i am getting the data is visible? Can you please expalin how i can do it?
    e.g. I do not want the header of the source to be visible in my page.

    • webvitaly Post author

      IMHO it is not possible to do with iframe. You can embed only whole site via iframe.

  6. Pingback: Wordpress Update (3.5.1) – February 13th – Columbia Blogs

  7. I have two different website with two different iframe plug-ins (this iframe plugin on one and iframe preserver on the other) and on each, scheduled posts get stripped of the iframe when they post. I can go back in and add the iframe code and update the post, but I'm wondering if anyone else is having this problem.

    • webvitaly Post author

      I didn't met this problem on other sites.
      Your sites are stripping the [iframe] shortcode? Or html iframe tag is stripped?

  8. can you embed two different pages in different iframes using this? (we want to embed our media player and facebook in one page)

  9. could you please explain the get_params_from_url feature with some detailed examples?! I do not understand it in all details ...

    best greetings
    Pascal

    • webvitaly Post author

      Example: page url (where you want to embed iframe) - site.com/?prm1=11,
      shortcode of the iframe - [iframe src="embed.com" get_params_from_url="1"],
      iframe src - embed.com?prm1=11

      So iframe source url will have the get param from page url.

      • and if there are two get params like site.com/?prm1=11&ref=22 I have to set get_params_from_url="2" ?

        • webvitaly Post author

          get_params_from_url is boolean param, so if you want to enable it, just set get_params_from_url="1".
          All params from page url will be passed to iframe src.

          P.S. I tried to send a letter to your email and it failed.

Submit a comment

example: http://google.com
Allowed HTML tags: <a href="http://google.com">google</a> <strong>bold</strong> <em>emphasized</em> <code>code</code> <blockquote>
quote
</blockquote>

*