0

I am trying to embedd this website into my own website I have tried so using Iframe but the page is just blank.

The link I want to embedd is - https://www.zillow.com/homedetails/1-Anchorage-Way-APT-1505-Freeport-NY-11520/2094629656_zpid/?fullpage=true

Or - https://www.zillow.com/homedetails/1-Anchorage-Way-APT-1505-Freeport-NY-11520/2094629656_zpid?skinver=8&view=owner&fromapp=true&p=ios&appType=PA

My Iframe :

<iframe src="https://www.zillow.com/homedetails/1-Anchorage-Way-APT-1505-Freeport-NY-11520/2094629656_zpid/" width="420" height="315" frameborder="0" allowfullscreen="allowfullscreen"><iframe>

Thanks in advance.

3
  • Shortcodes and oembed ftw, iframes will get stripped out by WordPress for security reasons
    – Tom J Nowell
    Jun 1, 2017 at 15:52
  • Tom J Nowell Thanks for you help, I have the short code - [embed width="1000" height="500"]"URL"/[/embed] but all it does is display a hyperlink text. Jun 1, 2017 at 16:13
  • The embed shortcode wasn't intended for iframes, it's the shortcode version of OEmbeds, you will need to add your own shortcode instead. Luckily how to embed iframes is a topic that has been heavily covered in numerous articles plugins and other questions on this site
    – Tom J Nowell
    Jun 1, 2017 at 17:27

1 Answer 1

0

It may not work if the Zillow's server block being requested through iFrame. (You may check this at your console. Most big websites do block).

There is no way to you do that using an iFrame. But in cases like this, I like to create a pop-up (triggered by a click, so browser will not block). Something like this:

<a id="open_in_popup" href="https://google.com">Open</a>

<script type="text/javascript">
jQuery(document).ready(function($) {

    $('#open_in_popup').click(function(e) {
        e.preventDefault();   
        var width  = 600,
            height = 400,
            left   = ($(window).width()  - width)  / 2,
            top    = ($(window).height() - height) / 2,
            url    = this.href,
            opts   = 'status=1' +
            ',width='  + width  +
            ',height=' + height +
            ',top='    + top    +
            ',left='   + left;

        window.open(url, '_blank', opts);

        return false;
    });

});
</script>
3
  • Thanks for your answer and my website does have SSL, is there an alternative way to maybe embedding it? Jun 1, 2017 at 15:36
  • Bruno are you sure you haven't mixed those up? SSL is only an issue if you embed an insecure page inside a secure page, if the site in the iframe use HTTPS then that will not be an issue
    – Tom J Nowell
    Jun 1, 2017 at 15:54
  • Oh yeah. I guess I've inverted the rule. Jun 1, 2017 at 19:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.