Show address

This topic contains 8 replies, has 3 voices, and was last updated by  Giri 6 years, 9 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #384398

    Nick Hottinga
    Free User
    Post count: 27

    I saw the other thread of how to show an address underneath the title. I would like to see address in title and city in the sidebar.

    Right now it doesn’t show a city name in the sidebar.

    #384399

    Nick Hottinga
    Free User
    Post count: 27
    This reply has been marked as private.
    #384404

    Guust
    Moderator
    Post count: 29970

    Please update GD and both your themes first.
    I cannot find anything that is hiding that, but it may be because you need to update.

    Thanks

    #384539

    Nick Hottinga
    Free User
    Post count: 27

    Thanks for looking into it Guust. I will update the themes and the GD plugin.

    Edit: After the updates I don’t see any changes unfortunatly.

    #385348

    Nick Hottinga
    Free User
    Post count: 27

    Any other thoughts?

    #385357

    Guust
    Moderator
    Post count: 29970

    I cannot find the problem, I’ll get someone else to have a closer look. That may only be after the weekend though.
    Thanks

    #385523

    Giri
    Expired Member
    Post count: 3155

    Hi Nick, I don’t quite understand your address structure.

    I see different address in sidebar and different address in the featured area. (right next to author avatar)

    Did you customize those parts by adding any snippets?

    Please elaborate what you did. So I can assist you better.

    Thanks

    #385902

    Nick Hottinga
    Free User
    Post count: 27

    Thanks for your help!

    I read another topic on this forum where I can change the address and added that snippet into my WP account.

    function gd_custom_sd_details_output_address( $address = ” ) {
    global $post;

    $sd_address = ‘<div class=”sd-address”>’;
    if (isset($post->post_address) && $post->post_address) {
    $sd_address .= apply_filters(‘sd_detail_post_add’, $post->post_address, $post);
    }
    $sd_address .= ‘</div>’;
    $sd_address .= ‘<div class=”sd-address”>’;
    if ( geodir_is_page( ‘detail’ ) && !empty( $post ) && !empty( $post->post_neighbourhood ) && !empty( $post->country_slug ) && defined( ‘GEODIRLOCATION_VERSION’ ) ) {
    if ( get_option( ‘location_neighbourhoods’ ) && $neighbourhood_info = geodir_location_get_neighbourhood_by_id( $post->post_neighbourhood, true, $post->post_location_id ) ) {
    $sd_address .= ‘<div class=”sd-neighbourhood” style=”clear:both;”><span class=”geodir-i-neighbourhood” style=””><i class=”fa fa-location-arrow”></i> ‘ . __( ‘Neighbourhood:’, ‘geodirectory’ ) . ‘ </span> ‘ . $neighbourhood_info->hood_name . ‘</div>’ . $social;
    }
    }
    $sd_address .= ‘</div>’;
    $sd_address .= ‘<div class=”sd-address”>’;
    if (isset($post->post_city) && $post->post_city) {
    $sd_address .= apply_filters(‘sd_detail_city_name’, $post->post_city, $post);
    }
    if (isset($post->post_region) && $post->post_region) {
    $sd_address .= ‘, ‘ . apply_filters(‘sd_detail_region_name’, $post->post_region, $post);
    }
    if (isset($post->post_country) && $post->post_country) {
    $sd_address .= ‘, ‘ . apply_filters(‘sd_detail_country_name’, __($post->post_country, ‘geodirectory’), $post);
    }
    $sd_address .= ‘</div>’;

    return $sd_address;
    }
    add_filter( ‘sd_details_output_address’, ‘gd_custom_sd_details_output_address’, 10, 2 );

    Without this snippet there was only a city name and now people can see directly where it is located.
    I also want to add the city name in the sidebar because there was just a ZIP code and no city name.

    Do I need to add another code for that?

    /edit:

    How can I translate/edit the “Write a review” button into my native language?

    #385992

    Giri
    Expired Member
    Post count: 3155

    Hi Nick, just discussed with my team.

    You need location manager addon. You might have used that addon and then disabled city, region options

    Please activate that addon and then visit Place settings > Custom fields > Address > Enable city option there.

    You can deactivate the plugin after that if you don’t want multilocation.

    Hope that helps.

    Thanks

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

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

Open Support Ticket