Sidebar Address

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

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

Open Support Ticket
  • Author
    Posts
  • #380147

    Brad Ruoho
    Expired Member
    Post count: 4

    Hi I would like the address to be a line below the address field. Where can I change this?

    Currently it shows as follows.

    address: 123 Main St.
    Sometown, AL, 123435
    USA

    I would like it to show as

    address:
    123 Main St.
    Sometown, AL, 123435
    USA

    #380188

    Guust
    Moderator
    Post count: 29970
    #383198

    Brad Ruoho
    Expired Member
    Post count: 4

    Hi,

    I have reviewed https://wpgeodirectory.com/docs/changing-the-layout-of-addresses/ and installed the code snippets plugin but there is no change.

    Here is my code snippet. Based on the instructions.

    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 .= ‘ Address: ‘;
    $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_zip){ $html .= ‘<span itemprop=”postalCode”>’.$post->post_zip.'</span>
    ‘;}
    if($post->post_country){ $html .= ‘<span itemprop=”addressCountry”>’.$post->post_country.'</span>
    ‘;}
    if($post->post_region){}
    $html .= ‘

    ‘;
    }
    return $html ;

    This has no change to the website.

    #383200

    Guust
    Moderator
    Post count: 29970

    Please post your URL and WP admin details in a private reply so we can check the code and settings.
    Thanks.

    #383201

    Brad Ruoho
    Expired Member
    Post count: 4
    This reply has been marked as private.
    #383251

    Paolo
    Site Admin
    Post count: 31211

    hi,

    I don’t see the code snippets plugin installed and I can’t install it because the user is no network admin.

    Please let us know,

    #383254

    Brad Ruoho
    Expired Member
    Post count: 4
    This reply has been marked as private.
    #383270

    Paolo
    Site Admin
    Post count: 31211

    You were missing the final }

    The code snippet plugin was alerting every time you tried to activate that snippet.

    Also you didn’t add anything to the code that would change the address format.

    Thanks

    #383300

    Brad Ruoho
    Expired Member
    Post count: 4
    This reply has been marked as private.
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
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount