Documentation

Generate: Dynamic Elements: Wikipedia Image

Documentation »

Page Generator Pro » Generate: Dynamic Elements: Wikipedia Image
Wikipedia Images are available in Page Generator Pro 3.1.7 and higher, releasing Thursday April 8th 2021 23:59 UTC.  Ensure that your license is valid, not expired and that you’ve updated to the latest version of the Plugin.

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

Adding: Classic Editor / TinyMCE

To add a Wikipedia image 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 Wikipedia globe icon in the Visual Editor toolbar:
    Page Generator Pro: Dynamic Elements: Wikipedia Image: TinyMCE: Visual Editor

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 Wikipedia Image button in the toolbar:
    Page Generator Pro: Dynamic Elements: Wikipedia Image: TinyMCE: Text Editor

Adding: Gutenberg

To add a Wikipedia image 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 Wikipedia into the Search for a block field, and click the Wikipedia Image option that appears within the Page Generator Pro section
    Page Generator Pro: Dynamic Elements: Wikipedia Image: Gutenberg: Search Blocks
  • Follow the Configuration section below for each of the fields displayed in the right hand sidebar’s block panel:
    Page Generator Pro: Dynamic Elements: Wikipedia Image: Gutenberg: Configuration

Adding: Page Builders

To add a Wikipedia image 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-wikipedia-image parameter="value" ...]

ParameterAccepted ValueDescription
termstring or keywordFetch an image at random from the Wikipedia Page matching the given Term.  For example, Birmingham will fetch all images from the Birmingham Wikipedia Page, choosing one at random.
Multiple Terms must be separated by a semicolon ;
languagestringTwo character language code.
use_first_image0,1Whether to return the first image (1) or return an image at random (0).
copy0,1Whether to save the image to the Media Library.
sizethumbnail, medium, largeThe image size to output.  Other values may be available depending on the image sizes registered by your WordPress Theme and third party Plugins.
titlestring or keywordThe title to assign to the image.
captionstring or keywordThe caption to assign to the image.
caption_displayinteger (0,1)If enabled, displays the caption below the image.  Available in Page Generator Pro 4.5.2 and higher.
alt_tagstring or keywordThe alt tag to assign to the image.
descriptionstring or keywordThe description to assign to the image.
filenamestring or keywordDefine the filename to save the image as in the Media Library, excluding the extension.
attribution0,1If enabled, displays an image attribution below the image, linking to the author and license type the image is licensed under.
link_hrefstring or keywordDefine the link for the image. Leave blank for no link.
link_titlestring or keywordDefine the link title for the image.
link_relstringDefine the link rel attribute for the image.
link_targetstringDefine the link target for the image.
_blank New Window / Tab
_self Same Window / Tab
_parent Parent Frame
_top Full Body of Window
exif_latitudedecimal or keywordThe image’s location’s latitude.
exif_longitudedecimal or keywordThe image’s location’s longitude.
exif_commentsstring or keywordComments about the image.
exif_descriptionstring or keywordA description of the image.

Configuration: Search Parameters

Page Generator Pro: Dynamic Elements: Wikipedia Image: TinyMCE: Search

Term(s)

Specify one or more Terms or exact Wikipedia URLs to search Wikipedia.

Keywords are supported in the Term(s) field.

Where multiple Terms / URLs are specified, searching is performed in the order specified.  Once a matching article is found for a Term / URL, searching stops.  Therefore, it’s recommended that you specify the most exact Term / URL first, through to the least exact Term last (which acts as a fallback should no content be found for more precise Terms).

Specifying multiple Terms does not mean that images are collated from multiple articles.

To add a Term:

  • Start typing in the Term(s) field
  • Either click the ‘Add’ option which appears below the field, or press the Enter key
    Page Generator Pro: Generate: Shortcodes: Wikipedia: Add Term
  • Repeat for any additional Term(s) that you may wish to search for on Wikipedia

To re-order Terms (which determines the search order):

  • Drag and drop a Term to the left or right as necessary

To delete a Term, either:

  • Use the keyboard arrow keys within the field to move the caret to the right of a Term, and press the backspace key to delete it, or
  • Click the cross icon to the right of an existing Term.

Language

The language to use when searching Wikipedia for images.

Use First Image

If enabled, uses the first image found when searching Wikipedia. This will typically provide an image that is more relevant to the Term.

If disabled, uses an image at random from all images found when searching Wikipedia for the given Term.

Configuration: Output

The Display Caption option is available in Page Generator Pro 4.5.2, releasing Thursday 25th January 2024 23:59 UTC.
Page Generator Pro: Dynamic Elements: Wikipedia Image: Output

  • Save to Library: If enabled, stores the found image in the Media Library.
    • Additional attributes, such as Caption, Filename and EXIF metadata can then be set.
    • If disabled, the image will not be imported into the Media Library. This may result in faster generation times, and the image will be loaded direct from the third party image source.
  • Image Size: The image size to output.
    • Other values may be available depending on the image sizes registered by your WordPress Theme and third party Plugins.
  • 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.
    • If Save to Library isn’t enabled, this value is not set.  This is because the value is stored in the WordPress Media Library, and therefore requires that the image be saved to the Media Library
  • Display Caption: If enabled, displays the caption below the image.
    • If Save to Library isn’t enabled, this configuration option is not available.  This is because the caption is only stored when saving the image to the WordPress Media Library.
  • Description: The description to assign to the image.
    • This can be a keyword.
    • If Save to Library isn’t enabled, this value is not set.  This is because the value is stored in the WordPress Media Library, and therefore requires that the image be saved to the Media Library
  • 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.
    • If Save to Library isn’t enabled, this value is not set.  This is because the value is stored in the WordPress Media Library, and therefore requires that the image be saved to the Media Library
  • Show Attribution: If enabled, displays an image attribution below the image, linking to the author and license type the image license.
Page Generator Pro: Dynamic Elements: Wikipedia Image: TinyMCE: Link

  • Link: Define the link for the image. Leave blank for no link.
    • This can be a keyword.
  • Link Title: The title attribute for the link.
    • This can be a keyword.
  • Link Rel: Define any rel attributes, such as nofollow.
  • Link Target: Whether clicking the link should open in the same window/tab, new window/tab etc.

Configuration: EXIF

Page Generator Pro: Dynamic Elements: Wikipedia Image: TinyMCE: EXIF

The EXIF tab provides options to optionally write EXIF metadata to the image file.  This can be useful for Image SEO.

  • Latitude: The image’s location’s latitude.
    • If Save to Library isn’t enabled, this value is not set.  This is because the image must be stored on the local web site for the EXIF metadata to be written
  • Longitude: The image’s locations’ longitude.
    • If Save to Library isn’t enabled, this value is not set.  This is because the image must be stored on the local web site for the EXIF metadata to be written
  • Comments: Comments about the image.
    • If Save to Library isn’t enabled, this value is not set.  This is because the image must be stored on the local web site for the EXIF metadata to be written
  • Description: A description of the image.
    • If Save to Library isn’t enabled, this value is not set.  This is because the image must be stored on the local web site for the EXIF metadata to be written

If any value is blank and the imported image contains an existing value in the EXIF metadata, the existing value will be retained.

Any other EXIF metadata is retained.

Configuration: Errors

The Errors section is available in Page Generator Pro 4.9.3 and higher, releasing Monday January 6th 2025 23:59 UTC.  Ensure that your license is valid, not expired and that you’ve updated to the latest version of the Plugin.
Page Generator Pro: Dynamic Elements: Errors

Ignore Errors

If enabled, an error returned from the Dynamic Element will result in blank content output, instead of an error preventing generation of the entire Page / Post / Custom Post Type.

This setting may be useful if you don’t require the Dynamic Element to always return content output.

This setting is ignored when using Test mode. If the Dynamic Element produces an error, it will always be reported in Test mode, to assist with debugging.

Common Issues

No images found for the Term

Images exist on the Wikipedia page for the Term, but none of the image filenames were relevent

The Wikipedia article’s image filename must contain the Term.  This prevents images being displayed that have no relation to the Wikipedia article’s content.

If no accurate image can be found, ensure that the Term is specific.  For locations, this might mean including the full state, region or country.

If no accurate image can then subsequently be found, consider using a different image based Dynamic Element:


Published

Last Updated