Generate: Shortcodes


Videos are not designed to be a substitute for instructions. Please refer to the detailed Documentation below.

Overview

When creating or editing a Content Group, the Visual Editor allows for several dynamic shortcodes to be inserted into the content.  These allow rich media elements, such as a Video, Map or Image, to be displayed.

Page Generator Pro also supports Visual Editors in the supported Page Builders.
Shortcodes can be inserted into Gutenberg and any Page Builder, but you might have to directly insert the manual shortcode text itself.

Google Map

The Google Map shortcode inserts a Google Map, Satellite Map, Driving Directions or Street View into the content, depending on the shortcode’s parameters.

To add a Google Map:

  • Click the black Google Map marker icon in the Visual Editor toolbar:
    Page Generator Pro: Shortcodes: Visual Editor Buttons
  • Choose the Map Type from the dropdown in the modal window:
    Page Generator Pro: Shortcodes: Google Maps

Depending on the Map Type chosen, the following options are available.

Road Map

  • Location: Enter the city and country (or keyword, if you have one that has keyword data comprising of cities and/or countries).
  • Term: Optional. If specified, will plot matching businesses in the given location.  For example, to display Restaurants, you would enter Restaurants as the Term.
  • Height: The height of the Google Map, in pixels.
  • Zoom Level: Choose a zoom level for the Map.  A higher number means the map will be more zoomed in.

A shortcode will then appear within the content:
[page-generator-pro-google-map maptype="roadmap" location="{city}, UK" term="{service}" height="250" zoom="14"]

Parameter Accepted Value Description
maptype roadmap The map type to display
location string or keyword The location to display the marker on the map.  This should include a country, for example {city}, UK
term string or keyword Optional service to plot on the map. For example, restaurant would display a marker showing the nearest restaurant to the given location.
height integer The height of the map, in pixels.  Width is always 100%
zoom 0 to 21 The zoom level of the map.  A higher number means more detail

Satellite

  • Location: Enter the city and country (or keyword, if you have one that has keyword data comprising of cities and/or countries).
  • Term: Optional. If specified, will plot matching businesses in the given location.  For example, to display Restaurants, you would enter Restaurants as the Term.
  • Height: The height of the Google Map, in pixels.
  • Zoom Level: Choose a zoom level for the Map.  A higher number means the map will be more zoomed in.

A shortcode will then appear within the content:
[page-generator-pro-google-map maptype="satellite" location="{city}, UK" term="{service}" height="250" zoom="14"]

Parameter Accepted Value Description
maptype satellite The map type to display
location string or keyword The location to display the marker on the map.  This should include a country, for example {city}, UK
term string or keyword Optional service to plot on the map. For example, restaurant would display a marker showing the nearest restaurant to the given location.
height integer The height of the map, in pixels.  Width is always 100%
zoom 0 to 21 The zoom level of the map.  A higher number means more detail

Driving Directions

  • Location: Enter the starting zip code or city (or keyword, if you have one that has keyword data comprising of zip codes and/or cities).
  • Destination: Enter the destination zip code or city.
  • Height: The height of the Google Map, in pixels.
  • Zoom Level: Choose a zoom level for the Map.  A higher number means the map will be more zoomed in.

A shortcode will then appear within the content:
[page-generator-pro-google-map maptype="directions" location="{city}, UK" destination="B1 2JB" height="250" zoom="14"]

Parameter Accepted Value Description
maptype roadmap The map type to display
location string or keyword The location to display the marker on the map.  This should include a country, for example {city}, UK
destination string or keyword The destination
height integer The height of the map, in pixels.  Width is always 100%
zoom 0 to 21 The zoom level of the map.  A higher number means more detail

Street View

  • Location: Enter the zip code and/or address (or keyword, if you have one that has keyword data comprising of zip codes and/or addresses).
  • Country: Select the country the Location above belongs to.
  • Height: The height of the Google Map, in pixels.
  • Zoom Level: Choose a zoom level for the Map.  A higher number means the map will be more zoomed in.

A shortcode will then appear within the content:
[page-generator-pro-google-map maptype="streetview" location="{city}" country_code="GB" height="250" zoom="14"]

Parameter Accepted Value Description
maptype streetview The map type to display
location string or keyword The street view location. Either a zip code or address.
country_code string or keyword The two character country code for the location above.
height integer The height of the map, in pixels.  Width is always 100%
zoom 0 to 21 The zoom level of the map.  A higher number means more detail
Shortcode not working? Your location might need to comprise of both a city / town and country.

Media Library Image

The Media Library Image shortcode inserts a dynamic, random image from your WordPress Media Library for each generated Page.

It’s different from the standard Add Media option that WordPress provides, because the shortcode parameters help build a dynamic query to fetch an image at random from the Media Library.  For example, you might only want to output a Media Library Image that contains certain text in the title or the alt tag.

To add a Media Library Image:

  • Click the Media Library icon in the Visual Editor toolbar:
    Page Generator Pro: Shortcode: Media Library: Button
  • Enter the following information:
    Page Generator Pro: Shortcodes: Media Library

    • Title: Fetch an image from the Media Library at random with a partial or full match to the given Title
    • Caption: Fetch an image from the Media Library at random with a partial or full match to the given Caption
    • Alt Text: Fetch an image from the Media Library at random with a partial or full match to the given Alt Text
    • Description: Fetch an image at random with a partial or full match to the given Description
    • Image IDs: Fetch an image at random from a comma separated list of Media Library Image ID(s)
    • Image ID Range: Fetch an image at random whose ID matches or is within the given range.
    • Output: Image Size: The image size to output
    • Output: Alt Tag: The alt tag to output with the image.  If blank, the alt tag from the image in the Media Library is used.

A shortcode will then appear within the content:
[page-generator-pro-media-library title="title" caption="caption" alt="alt" description="descriptoin" ids="1,2,3" min_id="1" max_id="3" size="medium" alt_tag="alt tag to output"]

Parameter Accepted Value Description
title string or keyword Include images partially / fully matching the given Title.
caption string or keyword Include images partially / fully matching the given Caption
alt string or keyword Include images partially / fully matching the given Alt Text
description string or keyword Include images partially / fully matching the given Description
ids integer, comma separated integers or keyword Include images matching the given Image ID(s)
min_id integer or keyword Include images where their ID is greater than or equal to the given ID.
max_id integer or keyword Include images where their ID is less than or equal to the given ID.
size string Output the image at the given WordPress registered image size. Must use a value from WordPress’ get_intermediate_image_sizes() function.
alt_tag string The alt tag to output with the image.  If blank, the alt tag from the image in the Media Library is used.

Unsplash Image

The Unsplash Image shortcode inserts a dynamic, random image from Unsplash’s library for each generated Page.

It’s different from the standard Add Media option that WordPress provides, because the shortcode parameters help build a dynamic query to fetch an image at random from the Unsplash Image Library.  For example, you might only want to output an image that contains a certain object.

To add an Unsplash Image:

  • Click the Unsplash icon in the Visual Editor toolbar:
    Page Generator Pro: Shortcodes: Unsplash Icon
  • Enter the following information:
    Page Generator Pro: Unsplash Shortcode

    • Term: Keyword(s) describing the image that you’d like to display (e.g. Birmingham or {city}, UK).
    • Image Size: Choose the image size to output. Small, Regular and Full are recommended.
    • Image Orientation: Optional, the image orientation you’d prefer.
    • Alt Tag: Optional, an alt tag to describe the image.  Keywords can be used.

A shortcode will then appear within the content:
[page-generator-pro-unsplash term="{city}, UK" size="full" orientation="landscape" alt_tag="{city}"]

Parameter Accepted Value Description
term string or keyword Image to display.
size string Image size to display.  Must be one of raw,full,regular,small,thumb
orientation string (Optional): Image orientation to display.  If defined, must be one of landscape,portrait,squarish
alt_tag string (Optional): Alt tag to assign to the image.

Wikipedia Content

The Wikipedia shortcode inserts text from Wikipedia about a given term (topic).

To add Wikipedia Content:

  • Click the Wikipedia icon in the Visual Editor toolbar:
    Page Generator Pro: Shortcodes: Visual Editor Buttons
  • Enter the following information:
    Page Generator Pro: Shortcodes: Wikipedia Modal

    • Term: Wikipedia title or keyword (e.g. Birmingham or {city}).
    • Language: Choose the language to return the content in.
Shortcode not working? Ensure that your term is a valid Wikipedia article.  If using a location, use a city only, or city + country.  Using a county may results in no results from Wikipedia, meaning no results output.

A shortcode will then appear within the content:
[page-generator-pro-wikipedia term="{city}, UK" language="en"]

Parameter Accepted Value Description
term string or keyword Wikipedia Article to display.
language string Two character language code

Yelp Business Listings

The Yelp! Business Listings shortcode inserts a grid of businesses matching the given term and location.

To add Yelp! Business Listings:

  • Click the Yelp icon in the Visual Editor toolbar:
    Page Generator Pro: Shortcodes: Visual Editor Buttons
  • Enter the following information:
    Page Generator Pro: Shortcodes: Yelp

    • Term: Business term(s) to find matching results for (e.g. Restaurants)
    • Location: The city to display Yelp Business Listings for, or use a keyword (e.g. Birmingham, UK or {city}, UK).  This should include a country, for example {city}, UK
    • Image: Whether to show or hide the business logo / image with each listing
    • Rating: Whether to show or hide the business rating with each listing
    • Categories: Whether to show or hide the business categories with each listing
    • Phone Number: Whether to show or hide the business phone number with each listing
    • Address: Whether to show or hide the business address with each listing
    • Number of Listings: The number of Yelp! Business Listings to display (e.g. 5)
Shortcode not working? Ensure that your location is valid, and comprises of both a city / town and country.

A shortcode will then appear within the content:
[page-generator-pro-yelp term="{service}" location="{city}, UK" image="1" rating="1" categories="1" phone="1" address="1" limit="3"]

Parameter Accepted Value Description
term string or keyword Business term(s) to find matching results for (e.g. Restaurants)
location string or keyword The city to display Yelp Business Listings for, or use a keyword (e.g. Birmingham or {city}).  This should include a country, for example {city}, UK
image 0,1 Whether to show or hide the business logo / image with each listing. 0 = hide, 1 = show.
rating 0,1 Whether to show or hide the business rating with each listing. 0 = hide, 1 = show.
categories 0,1 Whether to show or hide the business categories with each listing. 0 = hide, 1 = show.
phone 0,1 Whether to show or hide the business phone number with each listing. 0 = hide, 1 = show.
address 0,1 Whether to show or hide the business address with each listing. 0 = hide, 1 = show.
limit 1 to 50 The number of Yelp! Business Listings to display.

YouTube Video

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.

To add a YouTube Video:

  • Click the YouTube icon in the Visual Editor toolbar:
    Page Generator Pro: Shortcodes: Visual Editor Buttons
  • Enter the following information:
    Page Generator Pro: Shortcodes: YouTube 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.

A shortcode will then appear within the content:
[page-generator-pro-youtube term="{service}" location="{city}, UK"]

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

Refer to the Related Links Documentation.


Generation Performance

When using any of the above dynamic shortcodes, the Generation process will take a few seconds or longer for each Page.  Page Generator Pro converts the shortcode into actual HTML output, querying the third party services (Google, Wikipedia, Yelp, YouTube etc) to insert the actual contents into each Page.

This ensures that the resulting Page does not dynamically query these third party services every time your site visitor views the generated Page. Doing so would result in the page taking a long time to load for every single visitor (and, in turn, affect your rankings on SERPs).

By taking a one time performance hit on slower page generation, the performance of your generated Pages for SERPs and all site visitors is dramatically increased.

The Related Links Shortcode is not converted into actual HTML output.  This ensures that, at the point the visitor views a generated Page, the links are displayed in real time and reflect any updates you may have made (e.g. deleting Pages, regenerating Groups etc)