Want to add a YouTube playlist to your WordPress-based website? If you use Newspaper theme, you can previously add a YouTube playlist effortlessly using tagDiv Composer by just pasting the IDs of the videos you want to add. The new changes applied by Google now requires you to connect your website using an API to use Google products, including YouTube.
In this post, we will show you how to add a YouTube playlist in Newspaper X (the newest generation of the Newspaper theme).
Before getting started, make sure you have updated your Newspaper X theme to the latest version (version 10.3.1 at the time of writing). When updating your Newspaper X theme, you will also be prompted to update the tagDiv Composer plugin to the latest version. Visit this post if have no idea how to update your Newspaper theme.
Getting and installing the YouTube API key
Go to Google API Console and login with your Google account. Make sure to login with the same account as the one you use for YouTube. If you have no project yet, create a new one by clicking the dropdown menu on the top bar and click NEW PROJECT.
Give your new project a name and click the CREATE button.
Next, select the project you have just created via the dropdown menu on the top bar and click Library on the left panel.
Scroll down to the YouTube section. Select YouTube Data API v3 and click the ENABLE button to enable this API for your project.
Switch back to the main dashboard of Google API Console (you can do so by clicking the Google API Console logo on the top bar). Click Credentials on the left panel and click the CREATE CREDENTIAL link on the top side and select API key. Copy the generated API key.
Login to WordPress dashboard and go to the Newspaper theme panel (Newspaper -> Theme panel). Open the SOCIAL NETWORKS block and paste the API key you have just copied to the API KEY field on the YouTube API Configuration section. Click the SAVE CHANGES button to apply the change.
Creating the YouTube playlist
You can now start adding your YouTube playlist to your Newspaper X-powered website via tagDiv Composer. Create a new page and edit it with tagDiv Composer. Or, you can also edit an existing page. If you are new to tagDiv Composer, we have written this article for you.
On the tagDiv Composer front-end editor, add the Video Playlist shortcode (for YouTube) to the canvas area.
Click the Video Playlist shortcode to turn it into an editing mode so that you can make the configuration. This shortcode allows you to create a YouTube playlist from 4 source types: video IDs, channel ID, user name, and playlist ID. Select your preferred source and paste the ID to the available field. In this example, we use playlist ID.
Playlist ID itself is the random text after the “=” symbol on the playlist URL.
If you want to create a playlist from video IDs, simply paste the IDs of the videos you want to add to the playlist. Separate them with a comma.
Video ID is the random text after the “=” symbol on the video URL.
Under the General tab, you can set general settings to your playlist — other than adding the videos. Such as the disabling/enabling the autoplay, set the playlist width, set the playlist height, set the colors of the title, background, and so on.
You can go to the Css tab to style your playlist. You can set the margins, paddings, border color, border radius, background color, and so on.
Click the floppy disk icon on the top bar of the left panel once you are done editing your playlist to save all of the changes you made.