WordPress.org

Ready to get started?Download WordPress

Forums

Basic Google Maps Placemarks
[resolved] Single placemark on maps and functions.php question (4 posts)

  1. kryvulena
    Member
    Posted 1 year ago #

    Hello

    I really enjoy the plugin but I can't find a way to simplify displaying single placemarks on individual maps.

    I have ca. 500 placemarks grouped into 6 categories + 1 common category to display them all on a single map.

    But I also need to display separate maps with each placemark as a single spot on those maps. It does not make a sense to create ca. 500 separate categories for each placemark to chose from - especially that the list will grow...

    Same issue bothers me with updating functions.php with each single post slug. Each placemark has its own dedicated post with individual map. Now, to display them, I need to add each post slug into functions.php and the list is loooooooong.

    Is there a way to simplify this and making more convenient in use?

    Greetings and thanks for the plugin!

    http://wordpress.org/extend/plugins/basic-google-maps-placemarks/

  2. Ian Dunn
    Member
    Plugin Author

    Posted 1 year ago #

    If you edit a placemark, and click on the 'View Placemark' button at the top, you'll see that WordPress already generates a page for each individual marker.

    If you create a template in your theme for those pages, you can add the map shortcode to it so that the map shows up:

    <?php echo do_shortcode( '[bgmp-map]' ); ?>

    Check the Template Hierarchy page on the Codex to figure out what the template's filename should be. You can copy your single.php as a starting point.

    Then, to get it to only show the current marker, add a callback function for the bgmp_get-map-placemarks-query filter to a functionality plugin or your theme's functions.php, and set the p field to the current post's ID, which you can get using get_the_ID().

  3. kryvulena
    Member
    Posted 1 year ago #

    Thanks for quick reply. Unfortunately I'm not a php programmer and this is far beyond my ability to implement it :( Can you show any code examples?

  4. Ian Dunn
    Member
    Plugin Author

    Posted 1 year ago #

    1.9.3-rc2 is now available, which adds support for this.

    [bgmp-map placemark="105"]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.