Wrong Street Formatting in Swiss

This topic contains 5 replies, has 3 voices, and was last updated by  Paolo 8 years, 8 months ago.

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

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #121708

    Maria Alejandra Paccioreti
    Expired Member
    Post count: 11

    Hi there

    on listing and description the format is wrong for Swiss Format, actually the idea is that EVERYBODY can list his adress and event, thats why should be easy as posible.

    is:
    Street: 27,Schwizerstrasse
    Uster
    Zurich
    8610
    Switzerland

    Should be:
    Schwizerstrasse 27
    8610 Uster

    Street (as given in Front End, “street and number”)
    ZIP city

    we dont use “region=Canton” in Adress, we dont need the field Country in listing or detail (Because is a website for Adress and Events only in Switzerland, in back end is ok)

    Maybe i need to code that part, where should i code that? some tips?
    is posible to delete the House icon? (but is not to bad if we should leave it)
    how can we delete the word “Street:” on places listing? and detail as well.

    Thank you very much

    Maria Alejandra Paccioreti

    #121709

    Guust
    Moderator
    Post count: 29970

    These links should give you the info you need to change the address output:
    https://wpgeodirectory.com/support/topic/dutch-adres-syntax/
    https://wpgeodirectory.com/docs/how-to-use-gd-without-street-addresses/

    If you only have listings in one country, go to GD > Multilocations > and set country option to default country only.

    Add this CSS to hide the House icon

    .geodir-i-location i.fa {display: none;}
    #121710

    Maria Alejandra Paccioreti
    Expired Member
    Post count: 11

    i found the function geodir_show_listing_info($fields_location = ”)}
    in ..geodirectory/geodirectory-functions/custom_fields_functions.php

    i edit the code from line 2359:

    $html = ‘<div class=”geodir_more_info ‘ . $geodir_odd_even . ‘ ‘ . $type[‘css_class’] . ‘ ‘ . $type[‘htmlvar_name’] . ‘” style=”clear:both;” itemscope itemtype=”http://schema.org/PostalAddress”>’;

    $html .= ‘<span class=”geodir-i-location” style=”‘ . $field_icon . ‘”>’ . $field_icon_af;
    $html .= ‘ ‘;
    $html .= ‘</span>’;
    //print_r($_POST);
    if ($preview) {
    $html .= stripslashes($post->$html_var) . $addition_fields . ‘</p></div>’;
    } else {
    if ($post->post_address) {
    $myStringLS = $post->post_address;
    $myArrayLS = explode(‘,’, $myStringLS);
    $html .= ‘<span itemprop=”streetAddress”>’ . $myArrayLS[1] . ‘ ‘ . $myArrayLS[0] . ‘</span><br>’;
    }
    if ($post->post_zip) {
    $html .= ‘     <span itemprop=”postalCode”>’ . $post->post_zip . ‘ </span>’;
    }
    if ($post->post_city) {
    $html .= ‘<span itemprop=”addressLocality”>’ . $post->post_city . ‘</span><br>’;
    }
    $html .= ‘</div>’;
    }

    but, is there some child-theme or a place where i can customize the function without touching the core files? and how can i do that?

    Thank you very much

    Maria Alejandra Paccioretti

    #121712

    Guust
    Moderator
    Post count: 29970
    #121744

    Maria Alejandra Paccioreti
    Expired Member
    Post count: 11

    It Works!

    i am new with wordpres and dont know exactly how HOOKS works…

    Thank you very much!

    Maria Alejandra

    #121796

    Paolo
    Site Admin
    Post count: 31206

    You should never edit core files directly, that’s lesson number 1! 🙂
    Hooks help you avoid doing that. If you edit a core file, after evewry update of the plugin, you’d lose your changes.

    Thanks

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount