Skip Navigation

[Closed] Map field programmatically

This support ticket is created 3 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Shane 3 years ago.

Assisted by: Shane.

Author
Posts
#2282763

Hey There,

Here I have post type Certified practitioners,

where I have toolset field Location
hidden link

I want to render the map programmatically And I want it to fetch dynamically location field of each user(each post as I visit).

Display the location via marker
example: hidden link

Here is how I have implemented in the template
hidden link

Can you guide me on how do I achieve this programmatically, It will be great help. Thanks!

#2282811

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Keyur,

Thank you for getting in touch.

For clarity are you referring to rendering the map using php code ? Are you customizing your template using PHP code?

Please let me know.

Thanks,
Shane

#2283377

Yes!!!

#2283797

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Keyur,

Then you will need to make use of the do_shortcode() built in wordpress function to render the map shortcodes.

We don't have any custom functions that will be able to render the map itself so it will need to be done using the do_shortcode() function.
https://developer.wordpress.org/reference/functions/do_shortcode/

Here is the shortcode to render the map.
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-render

Here is the shortcode to render the marker.
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker

Please let me know if you have any further questions on this one.

Thanks,
Shane

The topic ‘[Closed] Map field programmatically’ is closed to new replies.