As you can see from the above we are checking 2 different terms in the listing type taxonomy, irish-cottage-for-rent and irish-cottage-for-sale . These are actually the slugs of the terms.
Next all we did was to provide a different marker_icon url for each.
In order for the has_term function to work you need to add it to the custom functions arguments in Toolset -> Settings > Frontend.
This support ticket is created 5 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.
Tell us what you are trying to do?
I need to have the markers for my seasonal locations be different from my regular locations.
Is there any documentation that you are following?
Toolsets
Is there a similar example that we can see?
Thanks for that info but Im still a little confused. Reading through that thread it looks like you guys worked through a couple of different options. Im worried that I dont even have it set up the correct way to make this change. As of right now I only have a custom marker for all locations on the map. I need to know how to even start the process of adding a custom marker.
This is what he did in his case to attach the markers to the taxonomy in a custom field.
In your case you may not need to do this.
Will your posts have a single term attached to it ? Because if so then you can just use some conditional code to change the markers based on the taxonomy the post has.
In order for the has_term() function to work you need to add it to the 3rd party view functions in Toolset -> Settings -> Frontend under "Functions inside conditional evaluations" just add the function name has_term. https://codex.wordpress.org/Function_Reference/has_term
Hello Shane,
I have added the function has_term. I also put it in the loop editor like this (see attached screenshot ). Its still not working so I think Im not doing something correctly or adding things in the right place. Let me know what exactly I need to adjust.
Are you referring to a specific taxonomy / category that is attached to that particular location?
Yes the specific term attached to the post.
Also what is the post tag the shortcode you provided me with referring to?
This is in Reference to the slug of the taxonomy, not the term. So if you have a taxonomy called Category then your terms can be beach, pool etc
So you need to provide the slug of the taxonomy.
You've added the shortcode correctly just change post_tag to the slug of the taxonomy.
Hello Shane can you give me a little assistance on this? I just need to know exactly where to put what? So the category/taxonomy of the markers is seasonal. This is within the location post type under location services. I hope Im telling you right? I just need to know where to put the proper term in the proper place of the code you gave me.
This is what I have in there now. I just need to know the proper terms for the code. I think I adjusted the post_tag to the slug of the taxonomy. But Its still not showing different markers. Are there other steps other than uploading a new marker and using this code?
I made that adjustment and it still does not seem to be showing the correct markers yet. Im attaching the updated code with the previous change you informed me to make. Let me know if there is something additional that needs to be done other than add this code.