I'm trying to embed an iframe into my blogger site. But the main problem is that Blogspot does not support iframe with HTTP URL and my target website is on HTTP.
this is my iframe example:
<iframe
src="http://mywebsite.com"
style="border:0px #ffffff none;"
name="myiFrame"
scrolling="no"
frameborder="1"
marginheight="0px"
marginwidth="0px"
height="400px"
width="600px"
allowfullscreen
></iframe>
Blogger shows the following warning:
There are HTTP resources on this page, because of which mixed content can negatively affect the security and display of certain elements when viewing your blog over a secure connection.
How can I embed an iframe with HTTP URL into Blogspot.com?
Blogger provides an option to Dismiss the warning. Refer to the screenshot -
Once that warning has been dismissed and you try to save the post once again, Blogger doesn't show any warning and saves the contents of the post.
Related
We are creating a service which hosts videos. Users upload videos to our website, and we provide embed codes for playback on their websites.
We have a number of users currently using Wordpress, so we figured we would create an oEmbed service to let users easily copy/paste links into their posts.
We followed a tutorial, and and registered the following provider in wordpress via wp_oembed_add_provider in functions.php
wp_oembed_add_provider('https://vectorly.io/*', 'https://vectorly.io/wordpress/embed');
We set up an oEmbed service endpoint (https://vectorly.io/wordpress/embed?url=....), which returns the following json
{
"version":"1.0",
"type":"video",
"provider_name":"Vectorly",
"provider_url":"https://vectorly.io/",
"width":"600",
"height":"340",
"thumbnail_width":"600",
"thumbnail_height":"340",
"thumbnail_url":"https://s3-us-west-2.amazonaws.com/m.cdpn.io/screenshot-coming-soon-small.png",
"title":"NVP DemoDay - Vectorly",
"html":"<iframe src=\"https://api.vectorly.io/embed/demo/ba37b243-46c4-4f60-9a12-f6885b95c661\" width=\"600\" height=\"340\" frameborder=\"0\" allowfullscreen />"
}
Embedly seems to validate the output
Copying and pasting one of our links (https://vectorly.io/watch/ba37b243-46c4-4f60-9a12-f6885b95c661) into the Wordpress post editor does seem to successfully grab the oembed details
But the embed content editor block doesn't show a preview of the video
The actual published post looks fine though
It seems that the preview block is loading the iframe properly, but is just setting the width and height as 0 during the preview.
Looking at other non-whitelisted oembed providers, this issue doesn't seem to come up, so I think I'm doing something wrong, but I can't figure out for the life of me what it is.
Mucking around in various Wordpress files, I think that other oEmbed links (even from non-whitelisted 3rd parties) are doing something to trigger sizing of the preview Iframe in Javascript.
Any insight on this would be appreciated. Otherwise, we'll just forego oEmbed and stick with vanilla html embed codes
In case anyone else stumbles on this issue in the future:
You need to provide iframe close tags when you send oembed responses to wordpress
I.E. The following does not work
<iframe src="..." />
The following does work
<iframe src="..." ></iframe>
Adding a figure tag improves the result. See the fixed oEmbed output from our server
{
"version":"1.0",
"type":"video",
"provider_name":"Vectorly",
"provider_url":"https://vectorly.io/",
"width":"600",
"height":"338",
"thumbnail_width":"600",
"thumbnail_height":"338",
"thumbnail_url":"https://s3-us-west-2.amazonaws.com/vv-raw-videos/ba37b243-46c4-4f60-9a12-f6885b95c661.png",
"title":"NVP DemoDay - Vectorly",
"html":"<figure><iframe src=\"https://api.vectorly.io/embed/demo/ba37b243-46c4-4f60-9a12-f6885b95c661\" width=\"600\" height=\"338\" frameborder=\"0\" allowfullscreen ></iframe></figure>"
}
I used business directory plugin which add listing section. Add the listing page, I try to add the map inside the listing page. The map seems to appear inside wordpress directory dashboard but it does not appear in the website. I know that this plugin got google map module, but is there any way to put google map without using the google map addon?Here is my code
<p style="text-align: center;"><img class="alignnone size-medium wp-image-291" src="https://harta-net.s3.amazonaws.com/uploads/2018/05/f84590ac-b53e-432d-9137-2241c7075f2d_tb-300x147.jpeg" alt="" width="300" height="147" /></p>
<iframe style="border: 0;" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3984.3164489624587!2d101.61260631430928!3d3.0093049978084196!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x31cdb36044fe6151%3A0x9c6f6535d01735ff!2sMasteron+Grand+Pavilion!5e0!3m2!1sen!2sin!4v1526629036980" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
directory dashboard image. Here is the link of my website
edit: Add the code and the website link
edit 2: try to use other google map plugin to add but still fail
edit 3: I found the problem is because I need to create a section for the google map inside business directory form to make it appears. Additional question, is it possible to only input adddress and auto change it from address to google map?
you can try to add this on any page,post or sections of content/text box
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3984.3164489624587!2d101.61260631430928!3d3.0093049978084196!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x31cdb36044fe6151%3A0x9c6f6535d01735ff!2sMasteron+Grand+Pavilion!5e0!3m2!1sen!2sin!4v1526629036980" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
Hi Did you added the api key for google maps for specific live url? if not then you have to create and after that you have to mention in your iframe
I have a video on Dailymotion that I'd like to display on my Wordpress website (X-Theme with Cornerstone).
I use a Video Player element and when I paste the URL of the video in the SRC & Poster field no video is being displayed.
I don't know much about this so I am open to any suggestions. (Is there maybe an other element which is more appropriate for this ? )
I chose DailyMotion rather than Youtube because I need an annotation linking to a page from my website.
You need to use Embedded video feature of the x theme to integrate/add the dailymotion video:
Use the following code inside the Embedded video in the embed code section and replace the video ID.
<iframe frameborder="0" width="480" height="270"
src="//www.dailymotion.com/embed/video/xwr14q?autoplay=1&mute=1"
allowfullscreen></iframe>
Screenshot
I am trying to create a like button for my weebly website. Weebly advises to use the IFRAME code but when I select this option with the facebook web developer, no code appears. What's going on?
<iframe src="//www.facebook.com/plugins/like.php?href=PUT_URL_HERE&width&layout=standard&action=like&show_faces=true&share=true&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px;" allowTransparency="true"></iframe>
And replace the PUT_URL_HERE with the url of the page you'd like to have your users like.
I am trying to generate some embeddable iframe code so a user can include the code on a blog to display content I'm planning to deliver. Right now the content I'm trying to deliver is just a website. I am trying to use the following code on a Wordpress blog:
<iframe width="420" height="315" src="http://www.cnn.com" frameborder="0"></iframe>
However when the page is viewed Wordpress simply outputs a link for "http://www.cnn.com" based on the following html.
http://www.cnn.com
That said, if I use Youtube generated iframe code, the iframe loads fine. For example:
<iframe width="420" height="315" src="http://www.youtube.com/embed/_OBlgSz8sSM" frameborder="0" allowfullscreen></iframe>
results in:
<iframe class='youtube-player' type='text/html' width='420' height='315' src='http://www.youtube.com/embed/_OBlgSz8sSM?version=3&rel=1&fs=1&showsearch=0&showinfo=1&iv_load_policy=1&wmode=transparent' frameborder='0'></iframe>
Any idea what Youtube is doing to enable this functionality or more generally how to get my simply iframe to work.
I don't know why you get an anchor instead of the iframe, but I know that google don't want their homepage in iframes. If you would have an iframe with the src http://www.google.com, you would see an empty iframe. Also see this example.
=== UPDATE ===
Wordpress prohibits iframes with few exceptions. Probably you can handle it with shortcodes. Try adding following untested code into the functions.php in your theme.
// [iframe src="www.cnn.com"]
function iframe_func($atts) {
extract(shortcode_atts(array(
'src' => 'default'
), $atts));
return '<iframe src="{$src}"></iframe>';
}
add_shortcode('iframe', 'iframe_func');
Now you can add [iframe src="www.cnn.com"] in the article editor in the wordpress admin.
Creating a shortcode is the way I get around this problem. It bypasses the WYSIWYG editor and puts the html in the page.
I would approach it like this.
Add this to your functions.php file:
function add_iframe($atts) {
extract(shortcode_atts(array(
'src' => '/'
), $atts));
$theframe = '<iframe src="'.$src.'" width="420" height="315" frameborder="0"></iframe>';
return $theframe;
}
add_shortcode('iframe', 'add_iframe');
Useage:
Add [iframe src=http://thesiteyouwanttoshow.com] to the content where you want the iframe to show.
If you are loading your own web page within the iframe remember that most hosted solutions will have xFrame options set to SAMEORIGIN, so no matter what you change in Wordpress, the page will still not render as it is being blocked by the target website.
I spent hours with this problem so hopefully if you are having this issue you will the target website as well. If you are hosting a solution on rails the answer I found is here and a website that will definitely load in Wordpress can be found here, so feel free to use that endpoint as a test.
Google uses the X-Frame-Options header (set to SAMEORIGIN) to prevent you from placing it in an iframe. Getting around this would require the user to use a browser that doesn't support X-Frame-Options.
Unfortunately the major search engine sites such as google and yahoo (bing excluded) don't allow for iframe embedding since they offer a plethora of APIs and integration options. So there is really no real way for you to do this. If you are not planning on embedding google as your iframe source then you should be in the clear with the current code that you have in place. Try it out and just change the source to something else - google will not show up in its place. If you want a search engine there unfortunately it is with horror that I say that bing is the only one that works.
Hope this helps!
So in recap - Google does not embed in iframe, but other content that you produce should based on your coding:
example:
<iframe width="420" height="315" src="http://www.uncrate.com" frameborder="0"></iframe>
http://jsfiddle.net/pKby8/
The Anchor that you get is a result of the xFrame option. When it connects to the google servers the servers kick back a cute response hinting that you should link to them instead of iframe.
I would create a WordPress short_code that would insert your iFrame in the output. I think by adding the iFrame code directly in the post box wordpress is changing it.
http://codex.wordpress.org/Shortcode_API