WordPress.org

Ready to get started?Download WordPress

Forums

Comprehensive Google Map Plugin
Is there a way to show adresses in posts on a google maps automatically (2 posts)

  1. bojan85
    Member
    Posted 1 year ago #

    I was wondering if there is a way to have addresses that are in the text of posts/pages automatically be added to a Google map without adding the address to the plugin manually?

    All the best,

    Bojan

    http://wordpress.org/extend/plugins/comprehensive-google-map-plugin/

  2. Elendil57
    Member
    Posted 1 year ago #

    Hi,

    You could use custom fields to enter your address and display it on the post.
    The value of the custom field 'adress' will be injected easily in the CGMP shortcode.

    For exemple, in my article editor, I wrote : ( with help of Exec-PHP for php directly inside posts, but could be inserted in pages or posts template )

    <?php
    global $post;
    $loca = get_post_meta($post->ID, 'adress', true);
    ?>

    and in the shortcode, I replace
    addmarkerlist="123 foo bar{}1-default.png"
    by
    addmarkerlist="<?php echo $loca?>{}1-default.png"

    It works, hope I've helped you,

    Regards,

    Elendil57

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.