I'm using a custom field (Map Location) for a custom post type. This works fine.
Every time a new cottage type post is added, even though the map is set correctly, on the front end it always defaults to a map of the horn of Africa. The client has to contact me every time to correct it.
I usually just log in, update the cottage post without actually changing anything, and this magically works. But my client can't do this same corrective action on her Mac. It's irritating because she has to contact me to do this every time a new cottage is added, even when I'm on holiday or away.
Last week, even this trick for correcting it didn't work for a new cottage and I had to wiggle the map marker and update the post for it to work. But normally just updating the post is enough. So, I'm concerned the issue is worsening.
The custom post for cottages uses a single page template written in PHP. To display the map, these shortcodes are included at the bottom of the template:
<?php echo do_shortcode ('[wpv-map-render map_id="map-1" map_height="400px" ]'); ?>
<?php echo do_shortcode ('[wpv-map-marker map_id="map-1" marker_id="marker-1" marker_field="wpcf-google-map-location"][/wpv-map-marker]'); ?>
Where could the problem lie? Any advice appreciated. No desperate urgency as this only crops up when a new cottage is added.
Thanks,
Josh.
Hello,
I assume you are going to display the map + marker shortcodes with PHP codes.
I suggest you try these:
1) Create a content template, display the map + marker shortcodes
2) Output about content template shortcode with Views API function render_view_template():
https://toolset.com/documentation/programmer-reference/views-api/#render_view_template
Thanks Luo.
I will try this approach and see if this helps.
Many thanks.