Jump to content

Archived

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

hansonexperience

youtube embed not working when last entry in post

Recommended Posts

Rob    547
Rob

No disrespect to Dreamhost here, but any 'shared' host has the difficult task of managing the resources on any machine and they have thousands.  One site on a server becomes popular and the rest slow down considerably.   It's probably best for you to be on VPS or even a dedicated machine (they're very inexpensive these days).  For example, I had a VPS account for US$59 a month, and now I could have a dedicated server for the same price.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
hansonexperience+    8
hansonexperience

Danny were do I enter those lines in Nicks function.php?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

You don't add both you only need to add the following to the functions.php file.

 

if ( ! isset( $content_width ) ) $content_width = 600;

 

Add the snippet at the bottom of the file.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Rob    547
Rob

Great!


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
hansonexperience+    8
hansonexperience

Danny very strange I even cannot reach that site.

Share this post


Link to post
Share on other sites
hansonexperience+    8
hansonexperience

Ah working now

Share this post


Link to post
Share on other sites
hansonexperience+    8
hansonexperience

Danny your trick: if ( ! isset( $content_width ) ) $content_width = 600; works but the height is also scaled with the width in such a way that it is not nice. How could I also force the height with such code?

Is there also a responsive code to use?

 

And is this code just for youtube or does it also have effect on other images or so?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

The code is Wordpress code, I recommend you ask this question on Wordpress support forums. As I am not aware of any code that is similar, but specific to height.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
hansonexperience+    8
hansonexperience

Danny yes but DMS does not the right thing. It enters somewhere a 600px in stead of doing it responsive. So it is also a DMS thing.

 

Where did find that code?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

As far as I am aware this is not a DMS issue, I mentioned in the answer that resolved the topic that you have two options, use the embed code along with width and height attributes or use this code

if ( ! isset( $content_width ) ) $content_width = 600;

I got that code from this article - http://www.wpbeginner.com/wp-themes/how-to-set-oembed-max-width-in-wordpress-3-5-with-content_width/

 

You can also use our responsive video shortcode (near bottom of page) - http://docs.pagelines.com/tutorials/shortcodes


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
hansonexperience+    8
hansonexperience

Danny the code you mentioned works but the height is not right for 16:9

I do not want the shortcode because then I have to change hundreds of postings on my blog :-)

 

Could I use a similar code as if ( ! isset( $content_width ) ) $content_width = 600; 

for the height? Such as if ( ! isset( $content_height ) ) $content_height = 500;

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

From what I have just read regarding that code the height is auto-determined to match the 16:9 ratio.

If this isn't the case you will need to contact Wordpress support.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • pehja
      By pehja+
      https://pehjaproduction.se/webbdesign/  Video is not showing up in Journey section. Why? I have entered this in the settings 
       
    • stephen2
      By stephen2+
      Hey, 
      I'm using your plug-in Video Slider. Everytime I enter an end time for the video - hit save and refresh - the plugin crashes.  The only to use it again is to deactivate it, delete the affected section and start over. 
      Any ideas? 
      Stephen
       
    • todd@kitetails.org
      By todd@kitetails.org
      HI -   I've been having problems with MediaBox cropping a Youtube video I am trying to embed.   Regardless of the size of the video, the bottom is cropped out. This is also regardless of the "Disable Media Vertical Centering" function and "MediaBox Min Height" settings in MediaBox.   I've been using the "Text and Embed HTML" box to embed the video, using a Pagelines shortcode, [pl_video type="youtube" id="KxJlJ7NbYLY"]   Any possible ideas as to where I am going wrong?   Thanks in advance for the assist!   Todd
    • DanatTLFN
      By DanatTLFN
      Hello there!
       
      I'm a bit panicky this evening as I was just making a quick change to the top half of my page when the DMS decided to stop loading up.
       
      The steps I took before refreshing are as follows: 
       
      Added in a Masthead
      Embedded a YouTube Video into the Video field on the editing panel
      Refreshed 
      Began pulling hair out
       
      After this I went to troubleshoot it and have deactivated all plugins however the problem still persists with all plugins deactivated. I am pretty sure it is a something to do with the Masthead, however not being able to get in and remove that section, makes seeing a solution somewhat rather difficult.
       
      Anyway I shall look forward to hearing your response.
       
      PS. I am running DMS 2 
      GoDaddy hosting
      and 21 Plugins all of which I have mentioned in previous posts.
    • tirsbak
      By 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 :-)
       
×