Google "Map Shortcode" For Local Business Schema In WordPress
Use the [wpt_schema_local_business_map /] map shortcode to show your business location on Google Maps. It uses data from the Local Business Schema.
Display your business location on Google Map using the wpt_schema_local_business_map shortcode
Pre-requisites
- A WordPress website
- WordPress Schema Plugin plugin
Tools
- Computer
Total Duration : 5 minutes
Start your FREE trial. You can cancel your trial anytime within the trial period.
Step 1 - Setup Local Business Schema For Your Website
-
Setup a Local Business Schema profile for your website.
-
For details, refer to https://wptools.app/how-to/how-to-add-local-business-schema-to-wordpress/
-
Ensure you have setup the Google Maps API Key
Start your FREE trial. You can cancel your trial anytime within the trial period.
Step 2 - Shortcode Documentation
-
[wpt_schema_local_business_map /] shortcode has the following attributes
-
- css_classes
- CSS classes of the main wrapper element of the shortcode html.
- post_id
- The ID of the post/page that has the opening hours for the business.
- If you don't use this attribute, the shortcode uses the current page
- oneline
- Whether to show address in single line or multi-line.
- 1 for single line address
- 0 for multi-line address
- Default value is 0
- width
- Set the width of the map.
- You need to supply the units. For example 400px, 100% etc
- Default value is "400px"
- height
- Set the height of the map.
- You need to supply the unit. Unit accepted is px
- Default value is "300px"
- zoom
- Set the zoom value of map.
- Lower zoom value shows the map from closer distance while larger value shows the map longer distance.
- Default value is "14"
- map_style
- Set the map type.
- Available values are
- roadmap
- satellite
- hybrid
- terrain
- Default value is "roadmap"
- scrollable
- Whether the map is scrollable or not
- 1 means scrollable. 0 stops scroll
- Default value is "0"
- draggable
- Whether the map is draggable or not.
- 1 makes the map draggable. 0 stops map drag.
- Default value is "0"
- show_info_window
- Whether to show the marker/pin information window when clicked.
- 1 shows the information window on click. 0 doesn't show information window.
- Default value is "1"
- show_street_address
- Where to show street address or not.
- Set 1 to show and 0 to hide.
- Default value is 1
- show_locality
- Whether to show locality in the address or not.
- Set 1 to show and 0 to hide.
- Default value is 1
- show_postal_code
- Whether to show postal code in the address or not
- Set 1 to show and 0 to hide.
- Default value is 1
- show_state
- Whether to show state in the address or not
- Set 1 to show and 0 to hide.
- Default value is 1
- show_country
- Whether to show country in the address or not
- Set 1 to show and 0 to hide.
- Default value is 1
- show_phone
- Whether to show the telephone number or not.
- Set 1 to show and 0 to hide.
- Default value is 1
- show_fax
- Whether to show the fax number or not.
- Set 1 to show and 0 to hide.
- Default value is 1
- show_email
- Whether to show the email address or not.
- Set 1 to show and 0 to hide.
- Default value is 1
- show_url
- Whether to show the URL or not
- Set 1 to show and 0 to hide.
- Default value is 0
- show_vat
- Whether to show the VAT ID or not.
- Set 1 to show and 0 to hide.
- Default value is 1
- show_tax
- Whether to show TAX ID or not
- Set 1 to show and 0 to hide.
- Default value is 1
- show_business_name
- Whether to show business name or not.
- Set 1 to show and 0 to hide.
- Default value is 1
- show_route
- Whether to show route/driving direction link or not.
- Set 1 to show and 0 to hide.
- Default value is 1
- dequeue_scripts
- Themes like Divi, enqueue Google Map API script which interferes with this shortcode.
- To make this shortcode work, remove these scripts.
- Pass a comma-separated list of WordPress script handles names of the such scripts.
- For Divi, the name of the handle is 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=" 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="" /]
- css_classes
Start your FREE trial. You can cancel your trial anytime within the trial period.