Generate: Dynamic Elements: YouTube Video

Overview

The YouTube Video shortcode inserts a video link from YouTube into the content for each generated Page.

Shortcode displaying as a link on the generated Page? Ensure that your Theme or Page Builder is using WordPress’ built in filters for rendering content and oEmbeds.

Adding: Classic Editor / TinyMCE

To add a YouTube video within the Classic Editor:

  • Ensure that you’re using the Visual Editor by clicking the Visual tab:
    Page Generator Pro: Dynamic Elements: TinyMCE: Visual Editor Tab
  • Click the YouTube icon in the Visual Editor toolbar (play button):
    Page Generator Pro: Shortcode Buttons

Adding: Classic Editor / TinyMCE: Text Editor

If you’re using the Text editor instead of the TinyMCE Visual Editor above:
Page Generator Pro: Dynamic Elements: TinyMCE: Text Editor Tab

  • Click the YouTube button in the toolbar:
    Page Generator Pro: Dynamic Elements: TinyMCE: Text Editor: Buttons

Adding: Gutenberg

To add a YouTube video within Gutenberg:

  • Click the plus icon between two existing blocks, or towards the top left corner of the Gutenberg editor
    Page Generator Pro: Generate: Dynamic Elements: Gutenberg: Add Block
  • Start typing YouTube into the Search for a block field, and click the YouTube option that appears within the Page Generator Pro section
    Page Generator Pro: Generate: Dynamic Elements: YouTube: Search Blocks
  • Follow the Configuration section below for each of the fields displayed in the right hand sidebar’s block panel:
    Page Generator Pro: Generate: Dynamic Elements: YouTube: Sidebar

Adding: Page Builders

To add a YouTube video within any Page Builder that supports a Text Editor widget/module using the Classic Editor (sometimes known as TinyMCE), refer to the Classic Editor instructions above.

Refer to the Dynamic Elements Documentation for details specific to your Page Builder.

If your Page Builder does not provide a Text Editor widget/block that uses the Classic Editor, you can still use Dynamic Elements.  However, you’ll need to manually build the shortcode, inserting it into your Page Builder’s content – for example:

[page-generator-pro-youtube parameter="value" ...]

Parameter Accepted Value Description
term string or keyword The search term(s) to use to search YouTube videos.
location string or keyword Optionally specify where the video is based.  This is used in conjunction with the Term above, so if we wanted to show an image of a building in Birmingham, UK, use Birmingham, UK

Configuration

Page Generator Pro: Generate: Shortcodes: YouTube: TinyMCE Modal

  • Term: Enter a search term.  For example, to display an image of a building, use building
  • Location (optional): Optionally specify where the video is based.  This is used in conjunction with the Term above, so if we wanted to show an image of a building in Birmingham, UK, use Birmingham, UK

Shortcode not working? Consider removing the location option to provide a broader resultset, from which a video can be used.

Common Issues

No video is output

  • Generate a Page in Test mode
  • View the draft Page, noting the error message.
    • If the error relates to exceeding a quota, you’ll need to provide your own YouTube Data API key.
    • If no video output and no error, no results could be found for the Term.  Simplify the Term.

Video URL is output

  • See first notice at the start of this documentation:
Shortcode displaying as a link on the generated Page? Ensure that your Theme or Page Builder is using WordPress’ built in filters for rendering content and oEmbeds.