Skip Navigation

[Résolu] trying to map serialized post meta

This support ticket is created Il y a 7 années. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par Noman Il y a 7 années.

Assisté par: Noman.

Auteur
Publications
#522843

I am trying to: place a map and use serialized post meta tocreate map

I visited this URL: lien caché

I expected to see:

Instead, I got:

#522975

Noman
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Karachi (GMT+05:00)

Hello Nathan,

Thank you for contacting Toolset Support. You can use our Toolset Maps plugin to display Maps in your site:
https://toolset.com/documentation/user-guides/display-on-google-maps/
https://toolset.com/documentation/user-guides/#toolset-maps

Further, if you are looking to do something else than above, I am not quite sure what is exactly required:

1.Please provide us step by step details of what you want to achieve? (with an example)
2. What you expected to see on the front page?
3. What you actually see right now?

Thank you

#522988

if you visit lien caché
you will see the post meta i have displayed via print_r ( unserialized data etc.....
I'm wondering how i can get use your map plugin to map the locations in this case longitude/latitudes on the above page... All of the data is stored in a serialized string and I am having to use some php to display it and format it but unsure how ishould go about to get map plugin to read each line item which is saved in stdclass to be displayed on map...

Any help is greatly appreciated...

Each custom post type business will have between 20 -150 locations that are stored in post meta like this and i need a way to extract lon/lat and map to display it ....

thanks!

#523098

Noman
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Karachi (GMT+05:00)

Hello Nathan,

Thank you for providing more details. So you would like to populate the lat/long of Toolset maps shortcode with your own values.

You have lat/lng in an array. You need to create a new shortcode to display maps in this way.
Then run your loop in functions.php file, in this loop you need to put following shortcodes:

[wpv-map-render map_id="map-[wpv-post-id]"]
[wpv-map-marker map_id="map-[wpv-post-id]" marker_id="marker-[wpv-post-id]" lat="42.2512805" lon="-71.820767"][/wpv-map-marker]

And put your latitude and longitude in above short code attributes.

==> So editable fields are
- [wpv-post-id] = unique value i.e auto incremented variable
- lat = your latitude value
- lon = your longitude value

Once you have created the shortcode, you can place that shortocde anywhere you want to display maps.

==> Maps Shortcodes: https://toolset.com/documentation/user-guides/maps-shortcodes/

This would require some advance PHP and JS custom coding to make it happen. We have some recommended list of service providers here if you would like to take a look: https://toolset.com/consultant/

Have a great day, Thank you

Ce ticket est maintenant fermé. Si vous êtes un client de Toolset et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance