WP Manifestindependent plugin directory
manifest / media / embed-youtube-shorts

Embed YouTube Shorts

WordPress plugin for importing and displaying YouTube Shorts with carousel layouts, playlist organization, and responsive design

by Gareth Hale, CitCom. · github.com/garethcitcom/embed-youtube-shorts · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/garethcitcom/embed-youtube-shorts/archive/refs/heads/main.zip

Readme

Embed YouTube Shorts Plugin# Embed YouTube Shorts Plugin

A comprehensive WordPress plugin that imports and displays YouTube Shorts using a custom post type system with playlist organization. Features advanced search, filtering, and multiple display layouts powered by the YouTube Data API v3.A comprehensive WordPress plugin that imports and displays YouTube Shorts using a custom post type system with playlist organization. Features advanced search, filtering, and multiple display layouts powered by the YouTube Data API v3.

Features## Features

🎥 Video Management### 🎥 Video Management

  • Custom Post Type: YouTube Shorts are imported as WordPress posts (youtube_short)- Custom Post Type: YouTube Shorts are imported as WordPress posts (youtube_short)

  • Playlist Taxonomy: Automatic playlist detection and organization using WordPress taxonomies- Playlist Taxonomy: Automatic playlist detection and organization using WordPress taxonomies

  • Smart Import System: Detects and imports videos from channel playlists automatically- Smart Import System: Detects and imports videos from channel playlists automatically

  • Automatic Cron Imports: Optional daily auto-import with WordPress cron integration- Automatic Cron Imports: Optional daily auto-import with WordPress cron integration

  • Comprehensive Video Data: Stores titles, descriptions, thumbnails, durations, view counts, and more- Comprehensive Video Data: Stores titles, descriptions, thumbnails, durations, view counts, and more

  • Local Storage: All video data cached locally for fast loading and reduced API calls- Local Storage: All video data cached locally for fast loading and reduced API calls

🎨 Display & Layouts### 🎨 Display & Layouts

  • Multiple Layouts: Display videos in grid, carousel (loop with center focus), or list layouts- Multiple Layouts: Display videos in grid, carousel, or list layouts

  • Responsive Design: Perfectly optimized for desktop, tablet, and mobile devices- Responsive Design: Perfectly optimized for desktop, tablet, and mobile devices

  • Professional Carousel: Infinite loop carousel with center focus using Splide.js library- Modal Viewer: Full-screen video player with YouTube embed

  • Modal Viewer: Full-screen video player with YouTube embed- Touch/Swipe Support: Carousel navigation with touch gestures on mobile

  • Touch/Swipe Support: Carousel navigation with touch gestures on mobile

🔍 Advanced Search & Filtering

🔍 Advanced Search & Filtering- Real-time Search: Live search with client-side and AJAX functionality

  • Real-time Search: Live search with client-side and AJAX functionality (disabled for carousel)- Playlist Filtering: Filter videos by specific playlists or multiple playlists

  • Playlist Filtering: Filter videos by specific playlists or multiple playlists- Search with Clear Button: Easy search clearing and state management

  • Search with Clear Button: Easy search clearing and state management- Accurate Result Counts: Shows total available videos, not just loaded count

  • Accurate Result Counts: Shows total available videos, not just loaded count- Load More Support: Choose between "Load More Button" or "Infinite Scroll" in admin settings

  • Load More Support: Choose between "Load More Button" or "Infinite Scroll" in admin settings (disabled for carousel)- Infinite Scroll: Automatic content loading when scrolling near bottom of videos

  • Infinite Scroll: Automatic content loading when scrolling near bottom of videos

⚡ Performance & Caching

⚡ Performance & Caching- WordPress Integration: Leverages WordPress post system for optimal performance

  • WordPress Integration: Leverages WordPress post system for optimal performance- Smart Caching: Reduced API calls through local post storage

  • Smart Caching: Reduced API calls through local post storage- Efficient Queries: Uses WordPress query system for fast video retrieval

  • Efficient Queries: Uses WordPress query system for fast video retrieval- Load More Pagination: Loads additional videos without page refresh

  • Load More Pagination: Loads additional videos without page refresh (grid/list only)

🛠 Developer Features

🛠 Developer Features- Shortcode System: Powerful shortcode with extensive parameters

  • Shortcode System: Powerful shortcode with extensive parameters- Taxonomy Support: Uses WordPress taxonomy system for playlists

  • Taxonomy Support: Uses WordPress taxonomy system for playlists- Admin Integration: Full WordPress admin integration with post management

  • Admin Integration: Full WordPress admin integration with post management- Debug Tools: Built-in playlist testing and debugging functionality

  • Professional Libraries: Splide.js v4.1.4 for carousel functionality

Installation & Setup

Installation & Setup

1. Install the Plugin

1. Install the Plugin- Upload the embed-youtube-shorts folder to your /wp-content/plugins/ directory

  • Upload the embed-youtube-shorts folder to your /wp-content/plugins/ directory- Or install directly through the WordPress admin dashboard

  • Or install directly through the WordPress admin dashboard- Activate the plugin via Plugins → Installed Plugins

  • Activate the plugin via Plugins → Installed Plugins

2. Configure API Settings

2. Configure API Settings- Go to Settings → YouTube Shorts in your WordPress admin

  • Go to Settings → YouTube Shorts in your WordPress admin- Add your YouTube Data API v3 key (see API setup guide below)

  • Add your YouTube Data API v3 key (see API setup guide below)- Add the Channel ID you want to import videos from

  • Add the Channel ID you want to import videos from- Click "Test Connection" to verify your settings

  • Click "Test Connection" to verify your settings

3. Import Videos

3. Import Videos- Once API is configured, click "Import Videos" in the settings page

  • Once API is configured, click "Import Videos" in the settings page- The plugin will automatically:

  • The plugin will automatically: - Fetch all videos from your channel

    • Fetch all videos from your channel - Filter for Shorts (videos under 60 seconds)

    • Filter for Shorts (videos under 60 seconds) - Detect playlist membership for each video

    • Detect playlist membership for each video - Create WordPress posts for each Short

    • Create WordPress posts for each Short - Organize videos using the playlist taxonomy

    • Organize videos using the playlist taxonomy- Progress is shown in real-time during import

  • Progress is shown in real-time during import

3.1. Optional: Setup Automatic Imports

3.1. Optional: Setup Automatic ImportsFor hands-free video management:

For hands-free video management:- Enable Auto-Import: Check "Enable automatic daily video import" in settings

  • Enable Auto-Import: Check "Enable automatic daily video import" in settings- Set Import Time: Choose when daily imports should run (server time)

  • Set Import Time: Choose when daily imports should run (server time)- Save Settings: The plugin will automatically schedule daily imports

  • Save Settings: The plugin will automatically schedule daily imports- Benefits: New videos are imported automatically without manual intervention

  • Benefits: New videos are imported automatically without manual intervention

Auto-Import Features:

Auto-Import Features:- 🔄 Daily Sync: Checks for new videos every 24 hours

  • 🔄 Daily Sync: Checks for new videos every 24 hours- ⚡ Light Import: Only imports new videos from the last day for efficiency

  • Light Import: Only imports new videos from the last day for efficiency- 📅 Weekly Deep Sync: Performs comprehensive import weekly to catch any missed videos

  • 📅 Weekly Deep Sync: Performs comprehensive import weekly to catch any missed videos- 📝 Automatic Logging: All import activities logged for debugging

  • 📝 Automatic Logging: All import activities logged for debugging- 🛑 Easy Control: Can be enabled/disabled anytime from settings

  • 🛑 Easy Control: Can be enabled/disabled anytime from settings

4. Manage Content

4. Manage ContentAfter import, you can:

After import, you can:- View Videos: Go to YouTube Shorts in the admin menu

  • View Videos: Go to YouTube Shorts in the admin menu- Manage Playlists: Access playlist taxonomy via YouTube Shorts → Playlists

  • Manage Playlists: Access playlist taxonomy via YouTube Shorts → Playlists- Test System: Use the "Test Playlists" link on the settings page

  • Display Videos: Use shortcodes on any page or post- Display Videos: Use shortcodes on any page or post

5. Display Videos### 5. Display Videos

Use the [youtube_shorts] shortcode anywhere in your content to display imported videos with full playlist filtering capabilities.Use the [youtube_shorts] shortcode anywhere in your content to display imported videos with full playlist filtering capabilities.

Getting Your YouTube API Key## Getting Your YouTube API Key

  1. Visit Google Cloud Console:1. Visit Google Cloud Console:

  2. Create or Select a Project:2. Create or Select a Project:

    • Create a new project or select an existing one - Create a new project or select an existing one

    • Make sure billing is enabled (required for API access) - Make sure billing is enabled (required for API access)

  3. Enable YouTube Data API v3:3. Enable YouTube Data API v3:

    • In the Cloud Console, go to APIs & Services → Library - In the Cloud Console, go to APIs & Services → Library

    • Search for "YouTube Data API v3" - Search for "YouTube Data API v3"

    • Click on it and press "Enable" - Click on it and press "Enable"

  4. Create Credentials:4. Create Credentials:

    • Go to APIs & Services → Credentials - Go to APIs & Services → Credentials

    • Click "Create Credentials" → "API Key" - Click "Create Credentials" → "API Key"

    • Copy the generated API key - Copy the generated API key

    • (Optional) Restrict the key to YouTube Data API v3 for security - (Optional) Restrict the key to YouTube Data API v3 for security

  5. Add API Key to Plugin:5. Add API Key to Plugin:

    • In WordPress admin, go to Settings → YouTube Shorts - In WordPress admin, go to Settings → YouTube Shorts

    • Paste your API key in the "YouTube API Key" field - Paste your API key in the "YouTube API Key" field

    • Click "Test Connection" to verify it works - Click "Test Connection" to verify it works

Finding Your Channel ID## Finding Your Channel ID

Method 1: From Channel URL### Method 1: From Channel URL

If your channel URL looks like: https://www.youtube.com/channel/UCxxxxxxxxxxxxxxxxxxxxxIf your channel URL looks like: https://www.youtube.com/channel/UCxxxxxxxxxxxxxxxxxxxxx

  • The part after /channel/ is your Channel ID (starts with UC)- The part after /channel/ is your Channel ID (starts with UC)

Method 2: From Custom URL### Method 2: From Custom URL

If your channel has a custom URL like: https://www.youtube.com/@YourChannelNameIf your channel has a custom URL like: https://www.youtube.com/@YourChannelName

  • You can use @YourChannelName as the Channel ID- You can use @YourChannelName as the Channel ID

  • Or use online tools to convert it to the UC format- Or use online tools to convert it to the UC format

Method 3: Using Browser Developer Tools### Method 3: Using Browser Developer Tools

  1. Go to your YouTube channel page1. Go to your YouTube channel page

  2. Right-click and select "View Page Source"2. Right-click and select "View Page Source"

  3. Search for "channelId" or "externalId"3. Search for "channelId" or "externalId"

  4. Copy the value (should start with UC and be 24 characters long)4. Copy the value (should start with UC and be 24 characters long)

Finding Your Playlist ID## Finding Your Playlist ID

Method 1: From Playlist URL### Method 1: From Playlist URL

If your playlist URL looks like: https://www.youtube.com/playlist?list=PLxxxxxxxxxxxxxxxxxxxxxIf your playlist URL looks like: https://www.youtube.com/playlist?list=PLxxxxxxxxxxxxxxxxxxxxx

  • The part after list= is your Playlist ID (starts with PL)- The part after list= is your Playlist ID (starts with PL)

Method 2: From YouTube Studio### Method 2: From YouTube Studio

  1. Go to YouTube Studio1. Go to YouTube Studio

  2. Navigate to "Content" → "Playlists"2. Navigate to "Content" → "Playlists"

  3. Click on your playlist3. Click on your playlist

  4. The Playlist ID will be in the URL bar4. The Playlist ID will be in the URL bar

Method 3: From Any Playlist Page### Method 3: From Any Playlist Page

  1. Go to any YouTube playlist page1. Go to any YouTube playlist page

  2. Look at the URL in your browser2. Look at the URL in your browser

  3. Copy everything after list= (should start with PL and be about 34 characters long)3. Copy everything after list= (should start with PL and be about 34 characters long)

Usage## Usage

Basic Shortcode### Basic Shortcode


[youtube_shorts][youtube_shorts]

Displays all imported YouTube Shorts using default settings.Displays all imported YouTube Shorts using default settings.

Read the full README on GitHub →