Skip Navigation

[Resolved] Use different maps marker for different categories

This support ticket is created 3 years, 7 months 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 – 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)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 3 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#2083457

Tell us what you are trying to do?

Hi I would like to use different maps marker for different categories. How can I do this? For Example: category1= blue, category2= red...

Is there any documentation that you are following?
Did not find anything about it.

Thanks!

#2084251

Hello,

You can try with [wpv-conditional] shortcode, check if current post has specific term, then display different map marker shortcode, for example:
1) Dashboard-> Toolset-> Settings-> Front-end Content
In section "Functions inside conditional evaluations", add WordPress function: has_term

2) Use a shortcode block to display different marker shortcode:

[wpv-conditional if="(has_term('my-taxonomy', 'my-term', null) eq '1')"]
[wpv-map-marker map_id="map-1"  marker_icon="<em><u>hidden link</u></em>" marker_id='marker-[wpv-post-id]' marker_field="wpcf-address-field-slug" marker_title=" "]
[wpv-post-link]
[/wpv-map-marker]
[/wpv-conditional]

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker