Pronamic Google Maps
[resolved] Mashups: How to display description in the popup box (4 posts)

  1. Nancy
    Posted 4 years ago #

    I'm using the mashup functionality: pronamic_google_maps_mashup

    By default it seems to put the post title in the popup bubble on the map. Is there a way to change this show it shows the description or address fields in addition to (or in place of) the post title, while still linking to the post?

    Great plugin, and thanks!


  2. Remco Tolsma
    Plugin Author

    Posted 4 years ago #

    Yes, there is a way:

    function prefix_pgmm_item($itemContent) {
    	$itemContent = '';
    	$itemContent .= '<h2>';
    	$itemContent .= '	<a href="'. get_permalink() .'">';
    	$itemContent .= '		'. get_the_title();
    	$itemContent .= '	</a>';
    	$itemContent .= '</h2>';
    	$itemContent .= '<h3>Address</h3>';
    	$itemContent .= wpautop(get_post_meta(get_the_ID(), '_pronamic_google_maps_address', true));
    	$itemContent .= '<h3>Description</h3>';
    	$itemContent .= wpautop(get_post_meta(get_the_ID(), '_pronamic_google_maps_description', true));
    	return $itemContent;
    add_filter('pronamic_google_maps_mashup_item', 'prefix_pgmm_item');
  3. John
    Posted 3 years ago #

    Problem is with that, when we update the plugin, changes are gone.
    Is there is a way to rewrite the output without touching to the plugin core code ?

  4. Remco Tolsma
    Plugin Author

    Posted 3 years ago #

    You can add the code above in your own theme or plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Pronamic Google Maps
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic