Shortcode for current post not working

Hi,

I'm showing the maps on my site using the following code:

<?php echo do_shortcode('[map query="current" is_responsive="true" disable_scroll="true"]') ?>

It should show up only the map that is associated with the current post. However, it shows all maps that have been associated to any post:

  • Rupok

    Hi Aldo Alfaro,

    I'm afraid, [map query="current"] is showing expected maps mashup. In our plugin usage guide, all parameters are explained for "query" parameter. I'm quoting those here:

    The following shortcodes can be used in posts to create mashups:

    [map query=”all”] – This shows all maps associated with any posts on the site.

    [map query=”current”] – This shows all maps associated with posts currently on the site.

    [map query=”random”] – This shows a random existing map. It always displays a single map.

    [map query=”tag=tagname”] – This shows all maps associated with any posts tagged with that tag on the site.
    For example, [map query=”tag=New York”] displays all maps associated with posts tagged New York.

    So when you use [map query="current"], it basically is showing all maps associated with all posts currently on the site.

    Can you please tell us what you are trying to achieve? Are you trying to show specific map for specific post? but not in the content area? If you want to use in content area, you can simply insert the map from editor box. Please check the attached screenshot for reference.

    Please let us know if you have any confusion or if you are stuck at any point. We will be glad to help.

    Have a nice day. Cheers!
    Rupok

  • Nithin

    Hi Aldo Alfaro,

    Hope you are doing good today. :slight_smile:

    What I'm trying to do is to automatically show the map associated to the current post outside the content area. How can I accomplish this?

    Could you please try the following code, and check whether it works:
    <?php echo do_shortcode('[map query="current_post"]') ?>

    You could also make use of the widgets, under Appearance > Widgets, in order to display maps of current post.

    I hope this helps, please let us know if you still need any further assistance. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.