Place code to open Google Maps in a different location

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

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

Open Support Ticket
  • Author
    Posts
  • #39778

    leonce153
    Buyer
    Post count: 87

    I’m using this code in function.php from a previous post to allow users to get directions from Google Maps:

    add_action(‘geodir_after_social_sharing_buttons’ , ‘buttonmap’, 10);
    function buttonmap(){
    global $post, $wp_query, $preview, $geodirectory;
    $postid = $wp_query->post->ID;
    $address= geodir_get_post_meta($postid,’post_address’,true); //address
    $e_add = str_replace(‘ ‘, ‘+’, $address); // + in space eg road+street+23

    $lat= geodir_get_post_meta($postid,’post_latitude’,true); //lat
    $lon= geodir_get_post_meta($postid,’post_longitude’,true); //lon
    //echo $e_add.$lat.$lon;

    echo “Get Directions“;
    }

    What I’m hoping you can help with is I want to place it just below the business listing address, but not sure what to replace this with to do so:

    geodir_after_social_sharing_buttons

    #39789

    Simone
    Expired Member
    Post count: 3515

    You can try with this

    
    
    geodir_after_detail_page_more_info
    

    rather than

    
    
    geodir_after_social_sharing_buttons
    

    and it will place after the block with the address (not right after the address)

    (PS: when you paste a block of code, please wrap it in the code button, here in the forum)

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