YouTube Feed Gallery

A YouTube feed gallery for WordPress that imports a channel or playlist and re-syncs it, so new videos appear with no page edits. The Social source is Pro.

The block reads a channel, or one playlist on it, through the YouTube Data API and stores the result in WordPress. Each video becomes a Social Item, with its thumbnail in the Media Library. Title, description, publish date, comments count, views count and the channel as the author come across with it. The videos stay on YouTube and play in the lightbox through its own player. Because the page renders from that stored copy, a quota error on Google’s side leaves the last import on screen until the next day.

The alternative is embedding videos one at a time, which means editing a page every time you publish. A connected account re-syncs on its own, and the videos get the same layout, skin and pagination controls as any other gallery. The one above is a two column grid on the Classic skin. Author, comments count and views count sit under each thumbnail, and a click opens the video in the popup.

What the YouTube account form asks for

Two panels are involved. The account lives in Settings, under the Social Feeds tab, and the block only picks it and decides how the videos look. The account fields, with their values and defaults, are on the YouTube feed documentation.

  • API Key and Channel ID are both required. The channel ID starts with UC and sits in YouTube under Settings, Advanced settings.
  • Medias of takes Channel or Channel Playlist, and defaults to Channel. Choose the playlist option and a Playlist dropdown appears, filled once the key and the ID are entered.
  • Max Videos, 1 to 200, default 30. That is how many of the newest videos each sync asks for, and the ceiling for All Items in the block.
  • Display Comments Count and Display Views Count are block switches rather than account fields. YouTube and Flickr are the only sources that fill both.
  • The daily quota is Google’s, not the plugin’s. A project gets 10,000 units a day, and a sync of 30 videos costs about 160. One channel on the two-hourly schedule stays far below that. Several accounts at Max Videos 200 can reach it.

Getting the channel onto a page

  1. In the Google Cloud Console, open a project, enable YouTube Data API v3 under APIs and Services, then create an API key under Credentials.
  2. In WordPress, go to Settings, Social Feeds, YouTube, click + Connect and paste the key and the channel ID. Set Max Videos and press Save Changes. Saving imports a new account straight away, without waiting for cron.
  3. Add the Visual Portfolio block, set Content Source to Social, then pick YouTube and the account. Click Action defaults to URL, which sends the visitor to the video on YouTube. Switch it to Popup to keep them on your page.

What a license buys on this page

The Social content source is the only paid piece in this demo. Everything else here ships in the free plugin on WordPress.org, and Pro contains that plugin, so one install covers both. The full split is in the free versus Pro comparison, and the license is on the pricing page.

  • The Social source and every network in its list are Pro. Point the same block at a Vimeo account and you get the Vimeo feed gallery.
  • The grid layout, the Classic skin, AJAX pagination and lazy loading are free. So is the popup lightbox that plays YouTube and Vimeo videos.
  • The Gallery block, the Elementor widget, the WPBakery element and Saved Layouts are free too, for reuse across a theme.

Questions about YouTube feeds

How often does the channel sync?

A full sync runs every 2 hours on WP-Cron, and a five minute job refreshes one account whose data is older than 3 hours. Sync All Accounts, on the Social Items screen, runs one now. WP-Cron fires only when someone visits the site, so a real cron job is what makes the timing dependable. The update schedule lists the jobs.

Can I edit an imported video?

Yes. Open Visual Portfolio, Social Items and change the title, the content, the image, the format or the links. A sync only adds posts it has not seen before, so the edit survives the next run. Trash an item instead and it leaves the gallery and is skipped from then on. See editing imported social posts.

Why are there no like counts?

They are not rendered, for any network. The gallery shows the author, the date, comments for YouTube, Vimeo and Flickr, and views for YouTube and Flickr. Both counters are a snapshot from the import, because a sync leaves an existing item alone. A video that gains views later keeps the number it arrived with. Why likes are missing covers the rest.