{"id":2481,"date":"2026-10-20T08:34:08","date_gmt":"2026-10-20T07:34:08","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-to-customize-the-map-bubble\/"},"modified":"2026-10-20T08:38:59","modified_gmt":"2026-10-20T07:38:59","slug":"how-to-customize-the-map-bubble","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/how-to-customize-the-map-bubble\/","title":{"rendered":"How to customize the map bubble"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The map bubble is the info window that opens when someone clicks a marker on a GeoDirectory map. You can change which fields it shows from the settings, and change the layout with a template in your child theme.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Choose the fields in the bubble<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to Places &gt; Settings &gt; Custom Fields.<\/li>\n\n\n\n<li>Click a field you want in the bubble, such as Phone or Address.<\/li>\n\n\n\n<li>In &#8220;Show in extra output location&#8221;, add Map bubble. Remove it from fields you don&#8217;t want there.<\/li>\n\n\n\n<li>Save the field.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Change the bubble layout<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The bubble content comes from a template file made of GeoDirectory shortcodes: the title, an image, the rating, the favorite link and <code>&#091;gd_output_location location=&quot;mapbubble&quot;&#093;<\/code> for the fields you picked above. To change it, copy the template into your child theme:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Copy <code>wp-content\/plugins\/geodirectory\/templates\/bootstrap\/map\/map-popup.php<\/code>.<\/li>\n\n\n\n<li>Paste it into <code>wp-content\/themes\/your-child-theme\/geodirectory\/bootstrap\/map\/map-popup.php<\/code>.<\/li>\n\n\n\n<li>Edit the copy. You can remove shortcodes, move them, or add others such as <code>&#091;gd_post_meta key=&quot;phone&quot;&#093;<\/code>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Using a child theme means your changes survive theme updates. See <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/customizing-templates\/\">customizing templates<\/a> for more on template overrides.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Show the address on one line<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By default the address puts each part on its own line. This snippet changes only the address in the map bubble so the parts are separated by commas:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">add_filter( &#039;geodir_cf_address_template&#039;, function( $template, $cf, $location ) {\n\tif ( $location === &#039;mapbubble&#039; ) {\n\t\t$template = &#039;%%street_c%% %%city_c%% %%region_c%% %%zip_c%% %%country%%&#039;;\n\t}\n\n\treturn $template;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the template, <code>_br<\/code> after a part adds a line break and <code>_c<\/code> adds a comma. Add the snippet with the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/useful-plugins\/code-snippets-plugin\/\">Code Snippets plugin<\/a> or your child theme&#8217;s functions.php.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If logos look too large in the bubble, see <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-map-styles\/how-to-fix-logo-size-issues-in-map-bubbles\/\">how to fix logo size issues in map bubbles<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The map bubble is the info window that opens when someone clicks a marker on a GeoDirectory map. You can change which fields it shows from the settings, and change the layout with a template in your child theme. Choose the fields in the bubble Change the bubble layout The bubble content comes from a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[211,432],"class_list":["post-2481","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=2481"}],"version-history":[{"count":1,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2481\/revisions"}],"predecessor-version":[{"id":2559,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2481\/revisions\/2559"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2481"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2481"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}