Google Map Shortcode For Local Business Schema In WordPress
The [wpt_schema_local_business_map /] shortcode embeds an interactive Google Map displaying your physical business location, populated dynamically from your Local Business Schema data.
Display your business location on Google Maps anywhere on your WordPress site using the shortcode.
Pre-Requisites
Section titled “Pre-Requisites”- A WordPress Website (5.0 or higher)
- Divi Theme or Divi Builder (optional, for Divi Modules)
- WordPress Schema Plugin For Divi, Gutenberg & Shortcodes
Setup Local Business Schema For Your Website
Section titled “Setup Local Business Schema For Your Website”
-
Configure a Local Business Schema profile for your website.
-
For step-by-step instructions, refer to the Local Business Schema Guide.
-
Ensure you have entered a valid Google Maps API Key in plugin settings.
FREE DOWNLOAD
Start your FREE trial. No credit card required.
Shortcode Parameter Reference
Section titled “Shortcode Parameter Reference”
-
The [wpt_schema_local_business_map /] shortcode supports the following customization attributes:
-
- css_classes: Custom CSS classes added to the map container element.
- post_id: The ID of the post or page containing the business location data. Omit this attribute to use the current page automatically.
- oneline: Address formatting style. Set
1for single-line inline address,0for multi-line formatting (default:0). - width: Map container width including units (e.g.,
100%,400px, default:400px). - height: Map container height in pixels (e.g.,
300px, default:300px). - zoom: Map initial zoom level (default:
14). Higher numbers zoom closer; lower numbers zoom out. - map_style: Google Map tile style. Supported values:
roadmap,satellite,hybrid,terrain(default:roadmap). - scrollable: Enable or disable mouse scroll wheel zooming. Set
1to enable,0to disable (default:0). - draggable: Enable or disable mouse map dragging. Set
1to enable,0to disable (default:0). - show_info_window: Display location info window when clicking the map marker pin. Set
1to enable,0to disable (default:1). - show_street_address: Show or hide street address in info window. Set
1to show,0to hide (default:1). - show_locality: Show or hide city/locality in info window. Set
1to show,0to hide (default:1). - show_postal_code: Show or hide postal/zip code in info window. Set
1to show,0to hide (default:1). - show_state: Show or hide state/region in info window. Set
1to show,0to hide (default:1). - show_country: Show or hide country in info window. Set
1to show,0to hide (default:1). - show_phone: Show or hide telephone number. Set
1to show,0to hide (default:1). - show_fax: Show or hide fax number. Set
1to show,0to hide (default:1). - show_email: Show or hide email address. Set
1to show,0to hide (default:1). - show_url: Show or hide business URL. Set
1to show,0to hide (default:0). - show_vat: Show or hide VAT ID. Set
1to show,0to hide (default:1). - show_tax: Show or hide Tax ID. Set
1to show,0to hide (default:1). - show_business_name: Show or hide business name heading. Set
1to show,0to hide (default:1). - show_route: Show or hide “Get Directions” link. Set
1to show,0to hide (default:1). - dequeue_scripts: Certain themes (such as Divi) load duplicate Google Maps API scripts that can conflict with shortcode map rendering. Pass a comma-separated list of conflicting WordPress script handles to unregister them (for Divi, use
google-maps-api). - Sample Usage:
[wpt_schema_local_business_map css_classes="" post_id="" width="400px" height="300px" zoom="14" map_style="roadmap" scrollable="0" draggable="0" show_info_window="1" show_route="1" show_vat="0" show_tax="0" show_business_name="1" oneline="1" show_street_address="1" show_locality="1" show_postal_code="1" show_state="1" show_country="1" show_url="1" show_email="1" show_phone="1" show_fax="1" dequeue_scripts="" /]
FREE DOWNLOAD
Start your FREE trial. No credit card required.