0

I am looking to embed youtube videos into my posts and publish them as custom post types (videos). I would like to be able to append the options for getting rid of the information bar, starting the video at a certain spot, and autoplaying the video upon load.

However, when I insert the link in the post currently, it spits out an ugly placement of the video. The video frame does not even fit within the post but stretches over the sidebar. Take a look here: http://diginomics.com/bitcoin-will-end-the-nation-state I have tried appending the customization to the end of the link with no success.

Is the only way to customize YouTube embeds with a shortcode and if so how could I go about doing this?

  • Exactly how are you embedding these videos? OEmbed? Direct OEmbed calls? Manually crafted embed codes? What's the code that displays the embeds? – Tom J Nowell Jan 5 '15 at 19:54
  • Also what is the embed/content width specified under media settings? – Tom J Nowell Jan 5 '15 at 20:13
  • I'm using the OEmbed function. I'm assuming this because all I'm doing is pasting the YouTube video link and it converts automatically. – Travis Patron Jan 6 '15 at 8:09
  • hmmm adding the additional parameter won't give you responsive youtube oembeds, which is what you need – Tom J Nowell Jan 6 '15 at 12:59
1

This might help. On the YouTube video page, choose Share, then choose Embed, then choose Show More. Remove checks in boxes for "Show Player controls" and "Show Video Title and Player Actions." Choose largest given width size or custom size that is equal to or slightly greater than your div container width. Copy the code. Paste the code into your post, then change the width number to width="100%" and adjust the given height number until it works well on preview post. (You need an absolute height number. Setting height to "auto" or to a percentage won't work.)

(No experience with autoplay.)

  • Please don't post links that are not relevant to promote your site or any site for that matter. :-) – Pieter Goosen Jan 7 '15 at 4:17
  • Thank you! That should work just fine. One final thing, how would I make a video such as this the featured image for my post? – Travis Patron Jan 8 '15 at 9:00
  • Happy it will help, Travis. Good question on making video a featured image. – Laura Jan 8 '15 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.