address format

This topic contains 1 reply, has 2 voices, and was last updated by  Paolo 7 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #378093

    mrv
    Expired Member
    Post count: 54

    I have added some code that formats the address under the listing title (on the detail listing page) in 2 lines like this…

    address
    city, state, zip

    This is the code I am using…

    /*show street address under listing title on listing detail page*/
    add_filter(‘sd_details_output_address’, ‘modify_sd_details_output_address’);
    function modify_sd_details_output_address() {
    global $post;
    $sd_address = ‘<div class=”sd-address”>’;
    if (isset($post->post_address) && $post->post_address) {
    $sd_address .= apply_filters(‘sd_detail_address’, $post->post_address, $post);
    }
    if (isset($post->post_city) && $post->post_city) {
    $sd_address .= ‘<br/>’ . 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_zip) && $post->post_zip) {
    $sd_address .= ‘, ‘ . apply_filters(‘sd_detail_zip’, $post->post_zip, $post);
    }
    $sd_address .= ‘</div>’;

    return $sd_address;
    }

    However, it only works in that one section. Would like to see all the addresses throughout the Supreme theme in this 2 line format. Is this something you can help me with?

    Thanks,
    Mike

    #378115

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    There is no full address below the listing page. The address in the detail listing page is only added in the sidebar.

    Below the title there are only the Country, Region and City.

    You’d need to modify another file to be able to do that and you’d lose the option to update the child theme.

    I asked to the developers to let us know if they added a hook to do that from within Code snippet plugin preserving updates.

    They’ll let you know after the week end.

    Thanks

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

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

Open Support Ticket