How do I add a YouTube playlist to an Elementor?

I recently demonstrated 4 different waysto embed a YouTube video in WordPress. Now you might be asking, How do I embed a YouTube playlist in WordPress?Youll be happy to know its quite easy, and the process is not that much different from embedding a single video. Lets take a look.

Animation of a YouTube playlist embed

There are 4 main ways to embed a YouTube playlistin WordPress:

  1. Using oEmbed [easiest]
  2. Using the embed shortcode [a few more options]
  3. Using an [a lot of customization]
  4. In your WordPress sidebar

Optimize & Grow your YouTube channel with the FREE TubeBuddy browser extension. 50+ tools for brands & creators to promote and manage your channel, right from the YouTube dashboard.

Watch the Video

If youre short for time, check out our video which covers the main ways to embed a YouTube playlist in WordPress.



Getting a YouTube Playlist URL

Before we can embed a YouTube playlist, its helpfulto know how to get the playlist URL. This isjust a little different from getting a video URL.

  • From anypage on youtube.com, open the menu from the top-left corner
  • UnderLibrary, click onthe playlist you want to embed
The playlist icon in YouTubes new design [Summer 2017]
  • This will take you to the main playlist page
  • The URL should look like this
//www.youtube.com/playlist?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G
  • Copy that URL to your clipboard

Alternatively, if youre watching a videowithin a playlist, youshould see the playlist name on the right side of the screen.Clicking on the playlist name will take you to the same URL.

Now well get into the various ways to embed the playlist on your WordPress site.

01Easiest Way to Embed a YouTube Playlistin WordPress

The easiest way to embed a YouTube playlistis to simply paste the playlist URL into the visual editor. Make sure youre using theVisual editor, and not inText mode.

Then just paste the YouTube URLon its own line, and WordPress will automaticallyadd the embed code for the playlist. You should see a preview right there in your visual editor.

This works because of a technology called oEmbed.There areother types of content you can insert into WordPress just by pasting the URL in your post screen.Learn more about WordPress oEmbeds»

02 Embed YouTube Playlistin WordPress using ashortcode

If youd like to set a maximum width or height on your playlist, you can use the embed shortcode.The instructions are exactly the same as embeddingvideos, so hop on over to ourYouTube video embed tutorial to learn about this method.

03 Embed YouTube Playlistin WordPress using an

Using an iframe to embed aYouTube playlistprovides you with more flexibility over how the playlist is displayed.

First, Ill show you how to embed the playlist, and then Ill explain the available options and how to set them up.

NOTE: This is currently only available in the classic version of the YouTube design. If youve enabled the new design, you can access the old version of a playlist by adding &disable_polymer=true to the end of the URL.

How to use the method

  • On YouTube.com, navigate to the playlistyou want to embed
  • Click onShare
  • Then click onEmbed

  • ClickingShow More will provide you with a few additional options, which well discuss in a moment
  • Copy the code
  • Go back to your WordPress editing screen, and click on the Texttab
  • Paste thecode on its own line, where you want the video to appear

The most basic code will look something like this:

[Optional] You can remove thewidth andheight parameters to force the playlist to automatically fit inside of its container.

How to customize a YouTube playlistvia the URL

Now Ill show you how tocustomizethe way in which the playlist appears on your site.

Here is a list of URL parameters you can add to the end of thesrc attribute, and what they do:

  • allowfullscreen This is not a URL parameter, but you removethis attribute fromthe to disable fullscreen mode
  • controls=0 Hides the player controls [play/pause, volume, captions, settings, fullscreen, etc.] at the bottom
  • showinfo=0 Hides the playlisttitle & sharing options at the top
    NOTE: This kind of defeats the purpose of embedding a playlist, because it removes the option to open the playlist up and view all videos.
  • autoplay=1 Starts playing the 1st video in the playlist automatically, when the page loads
  • loop=1 As soon as the last video in the playlist has ended, it willstart playing at the beginning of the playlist again
  • disablekb=1 Disables the keyboard controls
  • cc_load_policy=1 Automatically turns on captions
  • modestbranding=1 Removes the YouTube logo from the control bar
  • Privacy-enhanced mode This is done by checking the Enable privacy-enhanced mode checkbox. The URLchanges from www.youtube.com to www.youtube-nocookie.com.

View a full list of parameters & explanations»

Examples

Disable fullscreen mode [note allowfullscreen has been removed]:

Hide player controls controls=0:

Hide playlisttitle & sharing options showinfo=0:

Autoplay the 1st video in the playlist on page load autoplay=1:

Automatically loop the playlistloop=1:

You can combine as many of these options as youd like, just adding an & between each one. Your src attribute would look something like this:

//www.youtube.com/embed/videoseries?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G&controls=0&showinfo=0&autoplay=1&loop=1

04How to Embed a YouTube Playlistin your WordPress Sidebar

A new video widget was introduced in WordPress 4.8, and as of version 4.9, it now supports embedding YouTube playlists.

  1. Navigate to Appearance > Customize
  2. Click onWidgets
  3. Then find the sidebar area that you want to add the video to [you might have multiple sidebar areas listed]
  4. ClickAdd Widget
  5. Search for theVideowidget, and click on it
  6. Click theAdd Video button
  7. ClickInsert from URL
  8. Paste the playlist URL into the box
  9. ClickAdd to Widget
  10. At the top of the Customizer, clickPublish

Alternatively, you could use the method described above, and insert the code into aText Widget. Heres a quick animation:

  1. Navigate to Appearance > Customize [you could also go to Widgets, but Customize shows you a real-time preview]
  2. Click onWidgets
  3. Then find the sidebar area that you want to add the video to [you might have multiple sidebar areas listed]
  4. ClickAdd Widget
  5. Search for theTextwidget, and click on it
  6. Switch from Visual toTextmode
  7. Paste your embed code
  8. At the top of the Customizer, clickSave & Publish

Gimme a shoutin the comments if youhave any troubleembedding a YouTube playliston your WordPress site.

Video liên quan

Chủ Đề