• herrpedro

    (@herrpedro)


    does anyone has any code to add a map to “tags pages” or “category page” ?

    i’d like to display a map with all the places with info of the posts with that tag or category

    any ideas?

    thank you all

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Boris

    (@bobs1982)

    Let’s assume that you want to display a map on your categories archive page which a marker of all the posts in this category:

    1. Open the file category.php of your current template.
    2. Look for a proper location where the map should be displayed and insert the follwing php code:

    <?php
     if (is_category()) {
      $category = get_query_var('cat');
      if (class_exists('Geotag')) {
       Geotag::the_geotag('print_map', array('marker_query' => 'cat='.$category));
       }
     }
    ?>

    This examples uses the new the_geotag function of Geotag v2.0 which allows you to create maps in your templates. Just tell the function the current category_id and that’s it.

    Thread Starter herrpedro

    (@herrpedro)

    was hard to find the category listing since i got a “special” theme but it is in right place cause I put an Echo and it only appears in my category page 🙂

    the map does not show but it must be my “usual” problem…

    for tags…. is it tag?
    the rest I saw it in wordpress codex 🙂

    ‘<?php
    if (is_tag()) {
    $posttag = get_query_var(‘tag’);
    if (class_exists(‘Geotag’)) {
    Geotag::the_geotag(‘print_map’, array(‘marker_query’ => ‘tag=’.$posttag ));
    }
    }
    ?>

    Plugin Author Boris

    (@bobs1982)

    Yes, that should work. get_query_var('tag') should return the tag-slug and tag=... should be the right marker_query…

    Thread Starter herrpedro

    (@herrpedro)

    went from disable plugin in and disable plugin and.. got a map 🙂

    maps show all 🙂 (with markermanager and all :))) )

    category shows category maps (but only last 6.. no all 🙁 )

    tag does not show any map…
    added a “echo” in the if class_exists to check if it run geotag:: and the echo displayed my message

    Hi there.
    First of all, thanks for the great plugin.

    But i’d like to ask about one more functionality.

    Is there a possibility to edit the way, how the pop-out boxes on the map with multiple markers (e.g. on the category page) are displayed?
    I mean that pop-out box that is shown when you click on the marker — it displays the title and the date of post. Can I change that to, e.g., the title and the post thumbnail?

    I assume that i should edit the geotag.php file, but i don’t know exactly where and if it’s good thing to do without your permission.

    Plugin Author Boris

    (@bobs1982)

    @le soleil:
    Of course, you can modify the plugin as you like. Have a look at (approx.) line 2048 and 2065 where $markers[$i]['content'] is defined. The content of this variable will be used as the content of the infowindow for posts (2048) and for photos (2065).

    Thread Starter herrpedro

    (@herrpedro)

    hi all

    @bobs 🙂
    hi bobs ,

    about my issue

    “category shows category maps (but only last 6.. no all 🙁 )

    tag does not show any map…
    added a “echo” in the if class_exists to check if it run geotag:: and the echo displayed my message”

    if i may as 1 more thing…
    i can i change it to “if it is a post center on that marker although i have a query?”

    thank you for your patience

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Geotagging categorys and tags’ is closed to new replies.