GeoDirectory Support Forums Forums GeoDirectory Core Plugin General Discussion Address Format on Details Page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #361187

    Lance Sampson
    Buyer
    Post count: 108

    Hi

    I was given the attached code to format the address on the search page. How can I modify it to ALSO change the address to the same on the details page?

    Thanks

    Attachments:
    1. address-format.txt
    #361238

    Stiofan OConnor
    Site Admin
    Post count: 21763

    Hi Lance,

    Please see this post for upto date code, it will replace the other code u have:

    https://wpgeodirectory.com/support/topic/change-order-address/#post-279068

    Stiofan

    #361253

    Lance Sampson
    Buyer
    Post count: 108

    Hi Stiofan

    I tried this code and it doesn’t seem to work. First of all, can I put it into the snippets plugin and I am trying to change the address at the TOP of the details page on the supreme template. NOT the right sidebar. Is this the correct code for that?

    Thanks for your help!

    #361264

    paolo
    Site Admin
    Post count: 29635

    Hi,

    there is no address at the top of the detail page of supreme, just City, Region and Country.

    What are you trying to change?

    Thanks

    #361638

    Lance Sampson
    Buyer
    Post count: 108

    Paolo, I want the format below:

    address
    city, region zip.

    thanks for your help

    #361639

    paolo
    Site Admin
    Post count: 29635

    I think it’s easy to do, but you’ll probably have to apply the code after every update, I doubt there is a hook for it.

    The developers will let you know asap.

    Thanks

    #361674

    Giri
    Full Member
    Post count: 3155

    Hi Lance,

    Please try this code in code snippets.

    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;
    }
    #361793

    Lance Sampson
    Buyer
    Post count: 108

    That works great!

    Giri, thanks for all your help!

    This forum delivers great support.

    Best Regards

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

The topic ‘Address Format on Details Page’ is closed to new replies, this may be for inactivity, please open a new topic if you have a similar question.

  • How to add a new support ticket

    To open a new support ticket, first select the relevant forum and then click the "New Post" button. Example: You need support for the core plugin? Click on GeoDirectory Core Plugin support and click on the "New Post Button".
  • Support Policy

    Please read the support policy before starting to use the forum.
  • Are you a developer?

    Make Money with GD Jobs

    Get listed in the GeoDirectory Experts Directory. There may be a new client waiting for your services.
  • Looking for a GD developer?

    We do not provide customization services, but feel free to check out the GeoDirectory Experts Directory, there you'll find several freelance GD experts ready to start working with you.