Well, I would not have added a loop there if there was no need for that, but in some of the posts I planned 2 and more markers, actually.
Anyway, I did what you said and removed the loop:
if ($location[0] != '') {
echo '<p class="location">' . $location[0] . '</p>';
echo '<div class="single_map">';
echo do_shortcode('[wpv-map-render map_id="map-'.$post_id.'" map_width="100%" map_height="400px" single_zoom="'.$map_zoom.'"][/wpv-map-render]');
echo do_shortcode("[wpv-map-marker map_id='map-".$post_id."' marker_id='marker-1' marker_title='".$location[0]."' address='".$location[0]."'] ".$location[0]." [/wpv-map-marker]");
echo '</div>';
}
The first line that echoes the $location[0] as a text works fine. But as a part of the shortcode it displays a different location.
Maybe you should check the shortcode with your developers.
Thanks.
Hi, Shane is out on public holiday today but will return tomorrow to continue assisting you.
Shane
Supporter
Idiomas:
Inglés (English )
Zona horaria:
America/Jamaica (GMT-05:00)
Hi Valeriia,
Can I grab a copy of this site to run some further tests?
This way i can make a report to our development team about this should I be able to replicate this.
I really don't see a reason for the location to be different even when the variable is giving the correct location?
THanks,
Shane
Sure.
You can do it yourself or you want me to prepare it for you?
Shane
Supporter
Idiomas:
Inglés (English )
Zona horaria:
America/Jamaica (GMT-05:00)
Hi Valeriia,
What you can do is to restore the original code with the foreach and I'll just grab the package from your site.
Please let me know when I can do this.
Thanks,
Shane
Shane
Supporter
Idiomas:
Inglés (English )
Zona horaria:
America/Jamaica (GMT-05:00)
Hi Valeriia,
So i'm not able to see the map on my end when I restore the duplicator on my localhost. However changing the theme resolved this for me.
While debugging this I thought of an alternative that might work for you. Why not use a content template to display the map section.
Then load that content template into your page template using the php code for this.
https://toolset.com/documentation/programmer-reference/views-api/#render_view_template
This might end up resolving the issue for you.
Please let me know what you think of this since I'm having some difficulties debugging your instance and i'm not able to replicate on a fresh install.
Thanks,
Shane
Hello Shane,
Thanks for trying.
I will try what you suggested.
Have a nice day.