City name in Map Bubble

This topic contains 12 replies, has 2 voices, and was last updated by  Guust 6 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #386151

    Guy Leroux
    Expired Member
    Post count: 98

    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

    #386170

    Guust
    Moderator
    Post count: 29970

    Please add this CSS:

    
    
    .geodir-bubble-meta-side .geodir_more_info.post_address span[itemprop="addressLocality"] {
        display: initial;
    }

    Thanks

    #386178

    Guy Leroux
    Expired Member
    Post count: 98

    Hey 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

    #386182

    Guust
    Moderator
    Post count: 29970

    You have not copied the code exactly, look at the quotes.

    Let us know if that fixes it, Houba Houba Hop.

    #386184

    Guy Leroux
    Expired Member
    Post count: 98

    it 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

    #386185

    Guy Leroux
    Expired Member
    Post count: 98

    I mean city and province on the same line, code on another… 😉

    #386186

    Guust
    Moderator
    Post count: 29970

    Add 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

    #386187

    Guy Leroux
    Expired Member
    Post count: 98

    Gotcha! And as Gaston would say : M’enfin!

    Cheers,

    Guy

    #386190

    Guust
    Moderator
    Post count: 29970

    You’re welcome 🙂

    #386286

    Guy Leroux
    Expired Member
    Post count: 98

    Hi 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 ;
    }

    #386289

    Guust
    Moderator
    Post count: 29970

    If 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

    #386300

    Guy Leroux
    Expired Member
    Post count: 98

    Wow, that is absolutely fantastically super great… a zillion thanks Guust!

    🙂

    #386306

    Guust
    Moderator
    Post count: 29970

    You’re welcome 🙂

Viewing 13 posts - 1 through 13 (of 13 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket