Short Code Attributes

New home Forums Pro Add-on Short Code Attributes

Tagged: , ,

  • This topic has 2 replies, 2 voices, and was last updated 5 years ago by trekfind.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17307
    trekfind
    Member

    Are there any plans to implement shortcode tags as follows?

    marker title
    marker description
    marker icon
    allow directions
    more info link

    I believe these would be helpful for custom page meta data.

    Also, do you have a shortcode tutorial available?

    #17358
    Nick Duncan
    Keymaster

    Hi 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?

    #17429
    trekfind
    Member

    Sure,

    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 5 years ago by trekfind. Reason: added information
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Short Code Attributes’ is closed to new replies.