Jump to content


Photo
- - - - -

youtube embed not working when last entry in post

youtube

Best Answer Danny , 18 September 2013 - 12:15 PM

OK, apparently this is an issue with Wordpress 3.5 from what I've read and isn't theme specific. http://www.wpbeginne...-content_width/

You can either do one of two things - http://d.pr/i/8Vyi

 

You can either use the following code to set the width your self:

 
[embed width="123" height="456"] Add Media Link Here[/embed]

Or you can add the following to your child themes functions.php file:

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

Replace the 600 with the width of your content area.

Go to the full post


  • Please log in to reply
39 replies to this topic

#21 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 19 September 2013 - 09:05 AM

@Danny ah that's new for me. I am going to look into that. Looks like a good way of working. Thx!! Great support of you.



#22 Danny

Danny

    Is Awesome!

  • Moderators
  • 17966 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 19 September 2013 - 09:49 AM

No problem.

#23 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 19 September 2013 - 06:13 PM

@Danny right now testing on flywheel. Rick installed my blog and files but his conclusion is that my blog is still sluggish. So no solution I am afraid.



#24 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 20 September 2013 - 02:01 AM

I ran a test of http://www.hansonexperience.com/blog/ at http://tools.pingdom.com.  The result, unfortunately, is that your site took 12.54 seconds to load.  The truly bad part of this is that it took 10.35 seconds to load the domain.   That means it took about 2.15seconds to load DMS, WordPress, images, javascripts, etc.  That 10.35 seconds was strictly limited to the basic load time.  That's a server problem and totally unrelated to DMS, PageLines, or WordPress.

 

The server itself is taking 10 seconds to load basics, which is going to consistently slow you down.

 

You need to obtain support from your hosting company for this.

 

I should note here, that everything one might expect to slow a site down normally, such as compiled CSS, or images, plugins, scripts, etc... worked very, very well. Actually, wait times for everything other than the domain took a few microseconds. 



#25 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 20 September 2013 - 06:24 AM

@Rob yes I know and I am working on it. I am at Dreamhost provider. It is a SHared server, so that could be the problem. This trouble started after upgrading to wordpress 3.6 Before that I had no problems.

 

I tested with Flywheel but the same problem. So could also be partly a problem of Wordpress 3.6 as I read many complaints about slow wordpress 3.6

 

Right now I am setting up a testing environment in the Netherlands on a VPS. Looking into that solution.



#26 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 20 September 2013 - 07:05 AM

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.



#27 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 25 September 2013 - 08:32 AM

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



#28 Danny

Danny

    Is Awesome!

  • Moderators
  • 17966 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 25 September 2013 - 08:43 AM

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.



#29 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 25 September 2013 - 08:56 AM

@Danny thx/ Clear.



#30 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 25 September 2013 - 09:23 PM

Great!



#31 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 03 October 2013 - 10:12 AM

@Danny I cannot download the zip file of  https://github.com/b...icks-base-theme Do you have an alternative location?



#32 Danny

Danny

    Is Awesome!

  • Moderators
  • 17966 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 03 October 2013 - 10:22 AM

I've just downloaded the child theme without any issue:

 

https://github.com/b...hive/master.zip



#33 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 03 October 2013 - 10:31 AM

@Danny very strange I even cannot reach that site.



#34 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 03 October 2013 - 11:44 AM

Ah working now



#35 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 03 October 2013 - 12:21 PM

@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?



#36 Danny

Danny

    Is Awesome!

  • Moderators
  • 17966 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 03 October 2013 - 12:22 PM

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.



#37 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 03 October 2013 - 12:27 PM

@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?



#38 Danny

Danny

    Is Awesome!

  • Moderators
  • 17966 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 03 October 2013 - 12:35 PM

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.wpbeginne...-content_width/

 

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



#39 hansonexperience

hansonexperience

    Advocate

  • Members

  • 371 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 03 October 2013 - 12:41 PM

@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;



#40 Danny

Danny

    Is Awesome!

  • Moderators
  • 17966 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 03 October 2013 - 12:45 PM

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.