Hi everyone,
I have a quick question. Is it possible to have the “get directions” button open Google maps?
The code that I did found is from a few years back it isn’t working, unfortunately.
function geodirectory_detail_page_google_map_link( $options, $canvas ) {
global $post;
if ( $canvas == ‘detail_page_map_canvas’ && !empty( $post->post_latitude ) && !empty( $post->post_longitude ) ) {
$maps_url = add_query_arg( array(
‘q’ => get_the_title(),
‘sll’ => $post->post_latitude . ‘,’ . $post->post_longitude,
), ‘http://maps.google.com/’ );
?>
<p>” target=”_blank”><?php echo __( ‘Get Directions on Google Maps’, ‘geodirectory’ ); ?></p>
<?php
}
}
add_action( ‘geodir_map_after_render’, ‘geodirectory_detail_page_google_map_link’, 10, 2 );
Thank you for your time and help!