{"id":457,"date":"2023-10-21T06:39:11","date_gmt":"2023-10-21T06:39:11","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=457"},"modified":"2023-10-21T06:39:12","modified_gmt":"2023-10-21T06:39:12","slug":"wp-google-map-plugin","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/wp-google-map-plugin\/","title":{"rendered":"WP Google Map Shortcodes"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Wp Google Map Shortcodes<\/strong> to your WordPress website, including their <strong>parameters<\/strong>, <strong>examples<\/strong>, and <strong>PHP function code<\/strong>. Additionally, we&#8217;ll assist you with common issues that might cause the Wp Google Map  Plugin shortcodes not to show or not to work correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, here is an overview of the Wp Google Map  Plugin and the shortcodes it provides:<\/p>\n\n\n<p>    <div class=\"plugin-info-box\">\n        <div class=\"top-main\">\n            <!-- SVG Image -->\n            <div class=\"plugin-image\">\n                <img decoding=\"async\" src=\"https:\/\/ps.w.org\/wp-google-map-plugin\/assets\/icon-128x128.gif?rev=2840997\" alt=\"Plugin Icon\" \/>\n            <\/div>\n            \n            <div class=\"plugin-descriptive-part\">\n                <!-- Plugin Name with Link -->\n\n                    <a class=\"plugin-title\" href=\"https:\/\/wordpress.org\/plugins\/wp-google-map-plugin\" target=\"_blank\" rel=\"noopener\">\n                        \ufeff=== WordPress Plugin for Google Maps &#8211; WP MAPS                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;WP MAPS is a WordPress plugin for Google Maps integration. It simplifies embedding custom, interactive maps into your site. Ideal for businesses, bloggers, and event planners.&quot;                <\/p>\n            <\/div>\n        <\/div>\n\n        <!-- Rating and Additional Info -->\n        <div class=\"plugin-meta\">\n            <span class=\"plugin-rating\">\n                <span class='stars'>\u2605\u2605\u2605\u2605\u2729<\/span> (119)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 90000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 6.3.2            <\/span>\n            <span class=\"plugin-php-version\">\n                <strong>PHP Version<\/strong>: 5.3            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[put_wpgm]<\/li><li>[display_map]<\/li>            <\/ul>\n        <\/div>\n    <\/div>\n    <\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">WP Google Map  [put_wpgm] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The WP Google Map Plugin shortcode, &#8216;put_wpgm&#8217;, is designed to display a specific location on a map. \n\n\n\nThis shortcode calls the function &#8216;wpgmp_show_location_in_map&#8217;, which generates a map view based on the attributes provided. If an error occurs, it displays a message with the error details.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[put_wpgm]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; A basic usage of the shortcode to display a specific location on the Google map.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[put_wpgm id=1 \/]<\/code><\/pre>\n\n\n<p>Here, &#8216;id&#8217; is the unique identifier of the location that you want to show on the map. Replace &#8216;1&#8217; with the actual id of your location.<\/p>\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Using the shortcode to display a specific location on the Google map with additional attributes like &#8216;zoom&#8217; and &#8216;marker&#8217;.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[put_wpgm id=1 zoom=10 marker=\"yes\" \/]<\/code><\/pre>\n\n\n<p>In this example, &#8216;zoom&#8217; is used to specify the zoom level of the map, and &#8216;marker&#8217; is used to decide whether to show the marker on the map or not. Replace &#8217;10&#8217; with your desired zoom level and &#8216;yes&#8217; with &#8216;no&#8217; if you don&#8217;t want to display the marker.<\/p>\n<p>Using the shortcode to display multiple locations on the Google map.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[put_wpgm id=\"1,2,3\" \/]<\/code><\/pre>\n\n\n<p>In this example, you can specify multiple location ids separated by commas. The map will display all the locations with the specified ids.<\/p>\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[put_wpgm]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( 'put_wpgm',                      array( $this, 'wpgmp_show_location_in_map' ) );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction wpgmp_show_location_in_map($atts, $content = null) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\t$factoryObject = new WPGMP_Controller();\n\t\t\t\t$viewObject = $factoryObject-&gt;create_object( &#039;shortcode&#039; );\n\t\t\t\t$output = $viewObject-&gt;display( &#039;put-wpgmp&#039;,$atts );\n\t\t\t\t return $output;\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\techo WPGMP_Template::show_message( array( &#039;error&#039; =&gt; $e-&gt;getMessage() ) );\n\n\t\t\t}\n\n\t\t}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">wp-google-map-plugin\/wp-google-map-plugin\/wp-google-map-plugin.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">WP Google Map  [display_map] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The WP Google Map Plugin shortcode &#8216;display_map&#8217; is designed to display a map on your WordPress site. It uses a factory object to create a view object, which then displays the map.\n\n \n\nIn case of an error, it catches the exception and displays an error message. This ensures smooth user experience by handling potential issues efficiently.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[display_map]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; A basic usage of the &#8216;display_map&#8217; shortcode would be to simply call the shortcode without any parameters. This will display the map with default settings.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[display_map \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Displaying a map with specific attributes requires adding parameters to the shortcode. The parameters are added inside the shortcode brackets, separated by spaces. Each parameter is written as a key-value pair, with the key and value separated by an equals sign.<\/p>\n<p>For example, if you want to display a map with a specific zoom level and center coordinates, you would use the &#8216;zoom&#8217; and &#8216;center&#8217; parameters, respectively. The values for these parameters should be numbers representing the desired zoom level and coordinates.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[display_map zoom=10 center=\"40.7128, -74.0060\" \/]<\/code><\/pre>\n\n\n<p>Another example would be to display a map with markers at specific locations. This can be achieved by using the &#8216;markers&#8217; parameter. The value for this parameter should be a string containing the coordinates for each marker, separated by semicolons.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[display_map markers=\"40.7128, -74.0060; 34.0522, -118.2437\" \/]<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[display_map]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( 'display_map',                   array( $this, 'wpgmp_display_map' ) );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction wpgmp_display_map($atts) {\n\n\t\t\ttry {\n\t\t\t\t$factoryObject = new WPGMP_Controller();\n\t\t\t\t$viewObject = $factoryObject-&gt;create_object( &#039;shortcode&#039; );\n\t\t\t\t $output = $viewObject-&gt;display( &#039;display-map&#039;,$atts );\n\t\t\t\t return $output;\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\techo WPGMP_Template::show_message( array( &#039;error&#039; =&gt; $e-&gt;getMessage() ) );\n\n\t\t\t}\n\n\t\t}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">wp-google-map-plugin\/wp-google-map-plugin\/wp-google-map-plugin.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you&#8217;ve learned how to embed the <strong>Wp Google Map  Plugin shortcodes<\/strong>, understood the parameters, and seen code examples, it&#8217;s easy to use and debug any issue that might cause it to &#8216;not work&#8217;. If you still have difficulties with it, don&#8217;t hesitate to leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below, you&#8217;ll find a detailed guide on how to add the Wp Google Map Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the Wp Google Map Plugin shortcodes not to show or not to work correctly. Before starting, here is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"\ufeff=== WordPress Plugin for Google Maps &#8211; WP MAPS","slug":"","version":"4.5.3","author":"<a href=\"https:\/\/www.flippercode.com\">flippercode<\/a>","icons":"https:\/\/ps.w.org\/wp-google-map-plugin\/assets\/icon-128x128.gif?rev=2840997","plugin_tags":"{\"google-maps\":\"Google Maps\",\"map\":\"map\",\"maps\":\"maps\",\"wordpress-org-map\":\"wordpress org map\",\"wp-google-maps\":\"wp google maps\"}","author_profile":"https:\/\/profiles.wordpress.org\/flippercode\/","requires":"3.4","tested":"6.3.2","requires_php":"5.3","rating":86,"num_ratings":119,"active_installs":90000,"downloaded":2443918,"last_updated":"2023-09-12 3:38pm GMT","added":"2013-03-15","homepage":"https:\/\/www.flippercode.com","short_description":"Easy to use &amp; most advanced google maps plugin for WordPress. Create multiple google maps with custom marker icons, marker categories, custom info &hellip;","description":"\"WP MAPS is a WordPress plugin for Google Maps integration. It simplifies embedding custom, interactive maps into your site. Ideal for businesses, bloggers, and event planners.\"","shortcodes":"[\"put_wpgm\",\"display_map\"]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-457","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/comments?post=457"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/457\/revisions"}],"predecessor-version":[{"id":599,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/457\/revisions\/599"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}