Latest Youtube Video

I was getting a little fed up with remembering to update our church website with the latest livestream on a Saturday. So I created a new shortcode using the YouTube API to show the latest video from a specified playlist. That includes scheduled livestreams – So now when I schedule a new livestream, the website page for our online services is updated automatically. It’s a free feature, but you do need a Google API key for it too work!

To use the shortcode you need to find the playlist id. Simplest way is to login to https://studio.youtube.com and click on Playlists on the left hand side. That brings up your playlists

Next click on the playlist you want…

Copy what comes after the equals sign in the URL. Paste it in the shortcode

Then the shortcode is [church_admin type="latest-youtube" playlist_id="PL9Db2kQQWLNBowNKT5lraisS8KBiGss0q" cache="3600"]

You can also set a cache time in seconds- because each look up “costs” on unit. Caching it means less look ups. 3600 is one hour and 86400 is one day. If you set up the livestream schedule earlier in the week, go for a longer cache time!

And you will end up with your latest or upcoming video from the playlist. I set up the scheduled stream early in the week so it shows on the page early on and have a link to previous services that are on our sermons page.