We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket
Viewing 8 posts - 1 through 8 (of 8 total)
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketWe have moved to a support ticketing system and our forums are now closed.
Open Support TicketI have tried adding the following code to the functions.php page (I also tried using the snippets plugin) to get a URL link to Waze using the longitude and latitude address tags.
However, despite previous success by others in V1, I cannot get it to work for Waze in V2. Any suggestions please?
function geodirectory_detail_page_waze_map_link() {
global $post, $preview;
if ( !$preview && !empty( $post->post_latitude ) && !empty( $post->post_longitude ) ) {
$maps_url = add_query_arg( array(
‘?’ => $post->post_latitude . ‘,’ . $post->post_longitude,
), ‘https://waze.com/ul’ );
?>
<p>” target=”_blank”><?php echo __( ‘Get Directions on Google Maps’, ‘geodirectory’ ); ?></p>
<?php
}
}
add_action( ‘geodir_after_description_on_listing_detail’, ‘geodirectory_detail_page_waze_map_link’);
Hi gaz36f,
Thanks for your post. I’ve forwarded this to a developer for further assistance.
Thanks!
Thanks Kor!
Please try that with a badge. You should be able to use replace tags for lat and lon like %%latitude%% and %%longitude%% just like %%input%%
Hi Alex, yes, that is what I thought too. I tried it yesterday but I have just attempted it again since your post. Sadly, it doesn’t work.
If I put the %%latitude%% and %%longitude%% in the ‘Badge Text’ field, it recognizes the co-ordinates and duly enters them, as text.
However, if I use the same address tags in the ‘Badge Link URL’ field (i.e. https://waze.com/ul?%%latitude%%%%longitude%% ), it doesn’t recognize the tag and the URL is quite literally https://waze.com/ul?%%latitude%%%%longitude%% (i.e. no coordinates).
As a test in this field, I put https://waze.com/ul?%%input%% and it produced https://waze.com/ul?%5Bfirst line of address].
It looks like the address tags %%latitude%% and %%longitude%% work in the badge text field but not the badge url field.
Hi
the filter you are using not exist in v2.
for badge the link attribute only support %%input%% and %%post_url%%
it not support other tags because of security concern.
you can use below code in snippet and use [waze_link] as a shortcode to print the link.
Thanks
That’s absolutely great Naveen. It worked! 🙂
Just two very small things:
I added ‘?ll?’ after ‘ul’. I think I might have missed those earlier.
$maps_url = ‘https://waze.com/ul?ll=%%latitude%%,%%longitude%%’;
Also, if other people use this they might want to change the ‘Google’ to ‘Waze’ in this line here:
<?php echo __( ‘Get Directions on Waze Maps’, ‘geodirectory’ ); ?>
So happy to have this. Thanks again Naveen. Cheers, Gary
Thanks for confirmation and I am glad it works as per expectation.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketGet the latest news, tips, and exclusive content directly in your inbox.
Confirm your email address, and instantly receive the discount code :)