Community Forums › Forums › Archived Forums › General Discussion › Pictures Size Change When Youtube Video is Embedded In Metro
Tagged: Metro theme., Pictures Alignment, youtube, Youtube embed
- This topic has 6 replies, 2 voices, and was last updated 13 years, 2 months ago by
AnitaC.
-
AuthorPosts
-
September 3, 2013 at 1:45 am #60375
Rednasil
ParticipantHi,
I have a little problem with the pictures on my site. When I first add them to the post they are just full size, like this one
(http://listarama.com/20-adorable-cats-dressed-as-superheroes/)
But when I embed a youtube video (like on
http://listarama.com/20-biggest-amusement-parks-across-europe/) the whole formatting changes and the pictures appear smaller and not aligned well.And I only see half the pictures on mobile on both posts.
Anyone any suggestion on how to fix this?
September 3, 2013 at 7:33 am #60406AnitaC
KeymasterIt looks like you are adding the iFrame version of the embed code. WordPress added an update to the platform that allows you to just add the URL of the video and it will encode it on to the page for you without using the embed code. You should click the Share button on the video, grab that URL. Then go to the post, select the Text tab and not the virtual tab - paste the URL and Publish/Update. View the post and you will see the video. Try that and see how your images come out.
Need help with customization or troubleshooting? Reach out to me.
September 3, 2013 at 9:21 am #60432Rednasil
ParticipantThanks for your reply Anitac,
But I'm actually using the youtube url to embed the videos.
September 3, 2013 at 9:43 am #60442AnitaC
KeymasterOkay, try adding this to your Functions.php file at the bottom:
if ( ! isset( $content_width ) ) $content_width = 600;
You can adjust the 600 to whatever width you want the video to automatically size at. See if this makes a difference with your images. I added this to one of my clients and it seems to work for them.
Need help with customization or troubleshooting? Reach out to me.
September 3, 2013 at 9:53 am #60444Rednasil
ParticipantBefore I add the code to my site, I need to say that I think I found what is causing all this.
I used this code to add credits to my photo captions.
`add_filter('img_caption_shortcode', 'caption_shortcode_with_credits', 10, 3);function caption_shortcode_with_credits($empty, $attr, $content) {
extract(shortcode_atts(array(
'id' => '',
'align' => 'alignnone',
'width' => '',
'caption' => ''
), $attr));
September 3, 2013 at 9:59 am #60448Rednasil
ParticipantOkey, I went ahead and added your code anyways and it helped. My pictures are back at their normal size.
Thanks alot Anitac.
September 3, 2013 at 10:08 am #60450 -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.