City name in Map Bubble
This topic contains 12 replies, has 2 voices, and was last updated by Guust 7 years, 4 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: map bubbles
-
AuthorPosts
-
July 8, 2017 at 5:57 pm #386151
Hi guys,
I’d like to understand why the city name of my listing doesn’t show up in map bubbles and to fix that if possible.
In the listing settings, I clicked “yes” to have the city name integrated within the address, and “yes” for the address to feature into the map bubble.
So why isn’t the city appearing in the map bubble?
My site : https://depquebec.com
Thanks for looking into this… great plugin by the way, I’m more than happy so far.
Cheers,
Guy
July 9, 2017 at 12:49 am #386170Please add this CSS:
.geodir-bubble-meta-side .geodir_more_info.post_address span[itemprop="addressLocality"] { display: initial; }
Thanks
July 9, 2017 at 1:42 am #386178Hey Guust:
Thanks for the follow-up and I love that you feature Franquin’s Gaston Lagaffe, my childhood favorite.
I did add the suggested code in the script css box (see screenshot) but it did nothing.
Any idea?
Cheers,
Guy
July 9, 2017 at 1:54 am #386182You have not copied the code exactly, look at the quotes.
Let us know if that fixes it, Houba Houba Hop.
July 9, 2017 at 2:12 am #386184it works! I am happy as a Marsupilami!
Now, what would be the twist to :
a) put the city on the line below (instead of glued to the address, as now, and on the same line)
b) add the province and code as well, on another line (both on the same line)Thanks a million!
Guy
July 9, 2017 at 2:13 am #386185I mean city and province on the same line, code on another… 😉
July 9, 2017 at 2:31 am #386186Add the following part to the earier code to show the region:
.geodir-bubble-meta-side .geodir_more_info.post_address span[itemprop="addressRegion"]
So it becomes
.geodir-bubble-meta-side .geodir_more_info.post_address span[itemprop="addressLocality"], .geodir-bubble-meta-side .geodir_more_info.post_address span[itemprop="addressRegion"] { display: initial; }
To change the layout itself, like introducing a line break, review https://wpgeodirectory.com/docs/changing-the-layout-of-addresses/
Thanks
July 9, 2017 at 2:40 am #386187Gotcha! And as Gaston would say : M’enfin!
Cheers,
Guy
July 9, 2017 at 2:52 am #386190You’re welcome 🙂
July 9, 2017 at 6:40 pm #386286Hi Guust again:
I managed to get all the right fields where I wanted but even though I went through the doc, I can’t figure how to introduce line breaks where I want them to be, like right after “Home Address” (word and icon), and then right after the street address, that’s it.
Here’s the code I’m using in code snippet:
add_filter(‘geodir_show_post_address’, ‘geodir_change_address_order’ , 100 , 2) ;
function geodir_change_address_order($html , $vars)
{
global $post, $preview, $wpdb;
$field_icon=”;
if (strpos($field_icon,’http’) !== false) {$field_icon_af = ”;}
elseif($field_icon==”){$field_icon_af = ‘<i class=”fa fa-home”></i>’;}
else{$field_icon_af = $field_icon; $field_icon=”;}if(!$preview)
{
$html = ‘‘;
$html .= ‘<span class=”geodir-i-location” style=”‘.$field_icon.'”>’.$field_icon_af;
$html .= ‘ Adresse: ‘;
$html .= ‘</span>’;
//print_r($_POST);if($post->post_address){ $html .= ‘<span itemprop=”streetAddress”>’.$post->post_address.'</span>
‘;}
if($post->post_city){ $html .= ‘<span itemprop=”addressLocality”>’.$post->post_city.'</span> ‘;}if($post->post_region){ $html .= ‘<span itemprop=”addressRegion”>’.$post->post_region.'</span>
‘;}
if($post->post_zip){ $html .= ‘<span itemprop=”postalCode”>’.$post->post_zip.'</span>
‘;}
if($post->post_region){}$html .= ‘
‘;
}
return $html ;
}July 9, 2017 at 9:37 pm #386289If you want a line break after the address, just add a <br> like this:
if($post->post_address){ $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br> ';}
Thanks
July 9, 2017 at 11:52 pm #386300Wow, that is absolutely fantastically super great… a zillion thanks Guust!
🙂
July 10, 2017 at 2:16 am #386306You’re welcome 🙂
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket