Generate: Dynamic Elements: Yelp Business Listings

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

Adding: Classic Editor / TinyMCE

To add Yelp! Business Listings 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 Yelp icon in the Visual Editor toolbar (between Wikipedia and YouTube):
    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 Yelp button in the toolbar:
    Page Generator Pro: Dynamic Elements: TinyMCE: Text Editor: Buttons

Adding: Gutenberg

To add Yelp! Business Listings 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 Yelp into the Search for a block field, and click the Yelp option that appears within the Page Generator Pro section
    Page Generator Pro: Generate: Dynamic Elements: Yelp: 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: Yelp: Sidebar

Adding: Page Builders

To add Yelp! Business Listings 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-yelp parameter="value" ...]

 

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
radius 0 to 20 The maximum radius area to search.
minimum_rating 0 to 20 The minimum rating a business listing must have to be displayed.

As this is not supported by Yelp, using this option may result in fewer results than the Number of Listings option specified.  This is because the maximum number of Listings (50) are fetched, and then each Listing is checked to see if it meets or exceeds the Minimum Rating.  In some cases, this may result in fewer or no applicable Listings being displayed.
locale string The language to output results in.  This must match a Code listed at https://www.yelp.com/developers/documentation/v3/supported_locales
price 0 to 4 Only display listings matching or exceeding the given Price Level (0 = any, 4 = most expensive)
limit 1 to 50 The number of Yelp! Business Listings to display (e.g. 5)
sort_by string How to sort listings

  • best_match: A blend of rating and review count
  • rating: By rating
  • review_count: By the number of reviews
  • description: By description
output_type list,table The output type for the business listings:

  • list: Outputs a list or grid of Business Listings
  • table: Outputs a table of Business Listings
columns 1 to 4 When Output Type = list: The number of columns to display Business Listings in.  Any number from 1 to 4 is accepted.
image_alt_tag string, keyword or tag The alt tag for the image.  Keywords are supported, and the following tags will output business-specific information:

  • %business_name%: Business Name
  • %business_address1%: Business Address, Line 1
  • %business_address2%: Business Address, Line 2
  • %business_address3%: Business Address, Line 3
  • %business_city%: Business City
  • %business_zip_code%: Business ZIP / Postal Code
  • %business_country%: Business Country
  • %business_state%: Business State Code
  • %business_display_address%: Business’ Display Address (e.g. 123 Main Street, City, State Zip Code)
  • %business_phone%: Business Phone Number (e.g. +1234567890)
  • %business_display_phone%: Business Display Phone Number (e.g. (123) 456-7890)
  • %business_distance%: Distance from Search Point
  • %business_categories%: Business Categories
display_order string The order to display each Business’ attributes.

This is a comma separated list accepting the following values:

  • business_name: The Business’ Name
  • image: The Business’ Image / Logo
  • rating: The Yelp rating for the Business
  • categories: The categories the Business belongs to
  • phone: The Business’ Phone Number, in International Format e.g. +1234567890
  • phone_local: The Business’ Phone Number, in Local Format e.g. (123) 456-7890
  • address: The Business’ Full Address, including City, State Code and ZIP Code
  • address1: The Business’ Address, First Line
  • address2: The Business’ Address, Second Line
  • address3: The Business’ Address, Third Line
  • city: The Business’ Address City
  • zip_code: The Business’ Address ZIP Code
  • state: The Business’ State Code e.g. AL
  • country: The Business’ Country Code e.g. US
  • distance_km: The distance of the Business from the location parameter, in kilometers
  • distance_miles: The distance of the Business from the location parameter, in miles

For example:

  • business_name,image,rating,phone: Each Business Listing will display content in the order Business Name, Image, Rating and Phone Number

If blank or not defined, Related Links will each display content in the order Business Name, Image, Rating, Categories, Phone, Address

display_alignment string When Output Type = list: The alignment of each individual Business’ attributes:

  • vertical: Each Business’ attributes are output in the Display Order from top to bottom (in this example, Business Name, Image and Rating).
    Page Generator Pro: Yelp: Display Alignment: Vertical
  • horizontal: For each Business, the first Display Order attribute will be displayed, with the remaining Display Order attributes displayed to the right (in this example, Image, Business Name, Rating):
    Page Generator Pro: Yelp: Display Alignment: Horizontal

Configuration: Search Parameters

Page Generator Pro: Generate: Shortcodes: Yelp: Search: TinyMCE Modal

  • 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
  • Radius: The maximum radius, in miles, from the Location to include Business Listings for.
    • This cannot exceed 20 miles.
  • Minimum Rating: The minimum rating a business listing must have to be displayed.
    • As this is not supported by Yelp, using this option may result in fewer results than the Number of Listings option specified.  This is because the maximum number of Listings (50) are fetched, and then each Listing is checked to see if it meets or exceeds the Minimum Rating.  In some cases, this may result in fewer or no applicable Listings being displayed.
  • Language: The language to output results in.
  • Price: Only display listings matching or exceeding the given Price Level
  • Number of Listings: The number of Yelp! Business Listings to display (e.g. 5)
  • Sort Listings: How to sort listings

Configuration: Output

Page Generator Pro: Yelp: Output

  • Output Type: The type of listings that you want to output:
    • Grid/List: Displays a grid or list of business listings
    • Table: Displays a table of business listings
  • Number of Columns: The number of columns to display business listings in.  Not applicable when Output Type = Table.
  • Image Alt Tag: If defined, outputs the given text as the image’s alt tag.  Keywords are supported, and the following tags will output business-specific information:
    • %business_name%: Business Name
    • %business_address1%: Business Address, Line 1
    • %business_address2%: Business Address, Line 2
    • %business_address3%: Business Address, Line 3
    • %business_city%: Business City
    • %business_zip_code%: Business ZIP / Postal Code
    • %business_country%: Business Country
    • %business_state%: Business State Code
    • %business_display_address%: Business’ Display Address (e.g. 123 Main Street, City, State Zip Code)
    • %business_phone%: Business Phone Number (e.g. +1234567890)
    • %business_display_phone%: Business Display Phone Number (e.g. (123) 456-7890)
    • %business_distance%: Distance from Search Point
    • %business_categories%: Business Categories
  • Display Order: Defines the content display order for each Business
    • Click the field to see the available options
      Page Generator Pro: Yelp: Display Order Dropdown
    • Click each option that you want to display
    • Drag and drop each option to change the display order
      Page Generator Pro: Yelp: Display Order
  • Display Alignment: Defines the alignment of content within each individual Business:
    • Vertical: Each Business’ attributes are output in the Display Order from top to bottom (in this example, Business Name, Image and Rating, in a two column layout).
      Page Generator Pro: Yelp: Display Alignment: Vertical
    • Horizontal: For each Business, the first Display Order attribute will be displayed, with the remaining Display Order attributes displayed to the right (in this example, Image, Business Name, Rating, in a two column layout):
      Page Generator Pro: Yelp: Display Alignment: Horizontal
Shortcode not working? Ensure that your location is valid, and comprises of both a city / town and country.
The Yelp API does not return businesses without any reviews.  See Docs.

Common Issues

Yelp Shortcode Error: VALIDATION_ERROR: Field locale: Value ‘en’ does not match ‘^[a-z]{2,3}_[A-Z]{2}$’

You must specify a valid Language / locale, by either: