Skip Navigation

[Résolu] Display post count inside marker hint

This support ticket is created Il y a 3 années et 5 mois. 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Luo Yang Il y a 3 années et 5 mois.

Assisté par: Luo Yang.

Auteur
Publications
#2068401

Hello,

I have a CPT with a country field, and a map showing markers on each country where there are posts.

Question 1: Is there a way to display the post count on marker's hint using [wpv-found-count] or any other trick?

Question 2: Is there a way to keep the hint showing and not just on mouse hover?

#2068597

Hello,

Q1) It needs nested views, for example within the map marker shortcode, you can display a view shortcode, pass custom field "country" value as view shortcode attribute, for example "country":
https://toolset.com/course-lesson/passing-arguments-to-views/
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-view
Setup above post view as below:
- Query your CPT posts
- Filter by custom field "country" value = view's shortcode attribute "country"
- output the [wpv-found-count] shortcode

And if there are lots of markers in the same map, it will conducts performance problem.

Q2) There isn't such kind of built-in feature, you might consider custom codes, for example:
https://stackoverflow.com/questions/29796001/show-google-maps-infowindow-onload