New home › Forums › Pro Add-on › Short Code Attributes
- This topic has 2 replies, 2 voices, and was last updated 7 years, 5 months ago by trekfind.
-
AuthorPosts
-
October 15, 2015 at 7:02 pm #17307trekfindMember
Are there any plans to implement shortcode tags as follows?
marker title
marker description
marker icon
allow directions
more info linkI believe these would be helpful for custom page meta data.
Also, do you have a shortcode tutorial available?
October 16, 2015 at 1:20 pm #17358Nick DuncanKeymasterHi there.
Unfortunately I don’t have a shortcode tutorial available at the moment.
The plugin’s shortcode takes two parameters at the moment:
[ wpgmza id=’1′ cat=’cat_id’ ]
The ‘id’ is your map ID. This is mandatory. The category ID is optional 🙂
Would you mind explaining further what you mean, and how you’d like to see the above shortcodes implemented?
October 16, 2015 at 8:57 pm #17429trekfindMemberSure,
Basically what I am expanding on is the use of latitude and longitude custom fields.
I have this code in my template for posts:
<?php $typevalue = get_field( 'location', $post->ID ); if(empty($typevalue )) { echo ""; } else { echo do_shortcode("[wpgmza id='35' lat='$typevalue[lat]' lng='$typevalue[lng]' parent_id='35']"); echo '</p><hr />'; } ?>
What this does is pulls the lat and lon from the array and generates the map depending on the type of post that is being displayed.
I’m using Advance Custom Fields – https://wordpress.org/plugins/advanced-custom-fields/
The shortcode produced does exactly as expected, but leaves the marker unclickable. Adding the other attributes to allow for pulling in the infobox features would be helpful.
basically as follows:
echo do_shortcode(“[wpgmza id=’35’ lat=’$typevalue[lat]’ lng=’$typevalue[lng]’ title=’$marker_title’ description=’$marker_description’ more_info=’$marker_info’ directions_enable=’true’ parent_id=’35’]”);
- This reply was modified 7 years, 5 months ago by trekfind. Reason: added information
-
AuthorPosts
- The topic ‘Short Code Attributes’ is closed to new replies.