Generate: Shortcodes: Pexels

Don’t see the Pexels Shortcode? It’s new to Page Generator Pro 2.2.9 and higher.  Ensure that your license is valid, not expired and that you’ve updated to the latest version of the Plugin.

The Pexels shortcode inserts a dynamic, random image from Pexels for each generated Page.

This image is stored in your Media Library, as required by Pexel’s API usage.

In most TinyMCE instances, you’ll see an option to add the Pexels shortcode in the Visual Editor toolbar (green ‘P’ logo)
Page Generator Pro: Shortcode Buttons

A modal dialog will appear, with options split across two tabs:

Search Parameters

Page Generator Pro: Shortcodes: Pexels: Search Parameters

  • Term: Fetch an image at random from Pexels matching the given Term.
    • Keywords can be used.
  • Image Size: The image size to search for
  • Image Orientation: The image orientation to search for
    • When the image orientation is specified, the image size will be original.  This is a limitation of Pexels API, not Page Generator Pro.

Output

Page Generator Pro: Shortcodes: Pexels: Output

  • Title: The title to assign to the image.
    • This can be a keyword.
  • Alt Tag: The alt tag to assign to the image.
    • This can be a keyword.
  • Caption: The caption to assign to the image.
    • This can be a keyword.
  • Description: The description to assign to the image.
    • This can be a keyword.
  • Filename: Define the filename to save the image as in the Media Library, excluding the extension.
    • This can be a keyword.
    • It’s useful to use a keyword and/or other terms to ensure that the filename is SEO friendly and related to your content.
As the image found on Pexels will be stored in your Media Library, the above attributes are stored against the image in the Media Library.  It’s therefore recommended to complete at least the Alt Tag and Filename for SEO.

Click Insert to insert the shortcode.

A shortcode will then appear within the content:
[page-generator-pro-pexels term="cars" size="original" title="title" caption="caption" alt_tag="alt" description="description" filename="cars"]

Parameter Accepted Value Description
term string or keyword Fetch an image at random from Pexels matching the given Term.
size original, large2x, large, medium, small, tiny, portrait, landscape The image size or orientation to search for on Pexels.
title string or keyword The title to assign to the image.
caption string or keyword The caption to assign to the image.
alt_tag string or keyword The alt tag to assign to the image.
description string or keyword The description to assign to the image.
filename string or keyword Define the filename to save the image as in the Media Library, excluding the extension.