Jump to content

Archived

This topic is now archived and is closed to further replies.

tirsbak

Embed YouTube Videos Like in Google+ And Reduce Page Load Time.

Recommended Posts

tirsbak

Website URL: www.idphj.dk/e/k2
Framework Version: 2.1.5
WordPress Version: 4.0

 

Helo

 

I would like to use this trick on my site. But I can't figure out how to get it working. 

 

http://www.skipser.com/p/2/p/youtube-video-embed-like-google-plus.html

 

I have a few questions: 


"First, download and add the following javascript file to the header section of your page."

 

1) I have the file, but i don't know where to add it?

 

Next you need to call the "optimizeYouTubeEmbeds" function that will make your YouTube video embeds like the Google+ one. To do that, add the following code just before the ending </body> tag of your page.

 

 

2) Once again, I don't know where to add the script/code

I hope that someone can help me :-)

 

Share this post


Link to post
Share on other sites
Danny

HI,

 

1. You will need to do as the instructions suggest, download the file, then upload it to your site/server.

 

2. Once the file/script has been uploaded to your server, you're going to need to link to the script in custom script options area.

 

 


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
tirsbak

1. You will need to do as the instructions suggest, download the file, then upload it to your site/server.

 

Where on my server? 

Share this post


Link to post
Share on other sites
Danny

Anywhere, its entirely up to you, you can create a directory called scripts and upload them there or you can add them to your child theme if you're using one. All that matters, is that you upload them to your server and then in the script code, link to that location, which it mentions on that article.

 


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny

You need to use the following code in the custom scripts panel or enqueue it via the enqueue functions in a child themes functions.php file. To use the script method which is the easiest of the two, use the following code:

 

<script type="text/javascript" src="Add Script Path here"></script>
 
Replace Add Script Path here in the code above, to the location where you have uploaded the script.

Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I am using a plugin called Speed Booster Pack to speed up the load time of michaelkummer.com. One of the plugin settings, Minimize HTML and JavaScript causes an error that I only get with Pagelines. With other themes, such as WordPress' Twenty Seventeen, I do not get that error.
      I have reproduced the problem on my staging site and if you look at the JavaScript console, you will see the following error:
      SyntaxError: Unexpected end of script
      Any clue what PageLines may be doing differently to be contributing to this issue? I contacted the plugin developer and they, of course, pointed me to the theme developer
      Thanks
      Michael
    • flourishdesignstudio
      By flourishdesignstudio+
      Hello,
      We are working on a site and the customers are complaining that the site loads too slowly. They contacted their host who mentioned that the Java Script is all loading at the beginning. Is it possible to delay the load of the less important Java Script until after the initial load to speed up the site? The goal is to load the page faster by minimizing the initial javascript calls.
      Are there any preferred plugins that you would recommend or does this end up causing excessive problems with plugins, etc.?
      Thanks for the help!
    • pehja
      By pehja+
      https://pehjaproduction.se/webbdesign/  Video is not showing up in Journey section. Why? I have entered this in the settings 
       
    • chamois_blanc
      By chamois_blanc+
      I am trying to clone a container on a page. It throws the following javascript error:
      function l(b, c, e, f) { var g = m.a.f.get(b, p); if (!c) { if (g) throw Error("You cannot apply bindings multiple times to the same element."); m.a.f.set(b, p, !0) } I would appreciate guidance and a fix. Thank you
    • Jeremiah
      By Jeremiah+
      Error: editing.js?ver=930684:5 Uncaught TypeError: Cannot read property 'getData' of undefined
      I have all of the plugins disabled and I still receive the error.
      Page Editor will not load on page.
       
×