GEO my WP Support

Use this forum for technical support and general questions related to GEO my WP plugin and its core add-ons only. For technical support and general questions related to any of the premium extensions please open a new premium support ticket.

[Resolved]Calling Coordinates

Forums Support Calling Coordinates

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #58611

    Hi Eyal,

    I am very new to coding, so hopefully this is an easy question. I have the form shortcode up and running, but need to use the coordinates grabbed in a shortcode for another plugin (Events Manager-Full Calendar). I am trying to use the address coordinates to return the near events in their calendar. They already have the distance coded in, so all I need to know how to do is input the coordinates learned here into that function. This is what I have, but I don’t think it’s correct.



    Hello Beefi,

    It is not possible to pass the coordinates via the Current Location shortcode directly since it does not return a value only but an HTML element with map and other elements.

    There is the gmw_get_user_current_location() that returns the full current location details. So you could build a shortcode for it that will return only the values that you need, such as the latitude and longitude.

    I will add this to my to-do list for a future release of the plugin.


    Hi Eyal,

    Thanks for your response. If it’s not too much trouble, could you show me how to do what you suggested? I’m very new to coding <3 weeks and this is one of the last pieces of my site that I can’t figure out, no matter how much I research. If it would take you too long to do, could you give me a quick step by step? I hope I caught you before you log off. It’s very time sensitive.

    Thanks again,



    Add the script below to the functions.php file of your theme.

    Those function will enable 2 new shortcodes: [gmw_current_lat] to get the latitude and [gmw_current_lng] to get the longitude.

    So I believe ( and I hope ) that with the calendar shortcode you could do something like:

    I hope this helps.


    Actually, instead of the scripts above you can use one shortcode to get both coords like:

    Then try:

    The thing is that I am not even sure if you can pass a value to a shortcode using another shortcode. I’ve never tried this myself.

    The best way would be to use filters and a custom function to “inject” the coords directly into the calendar function.


    This topic marked “Resolved” due to inactivity. If you wish to reply to this topic please change its status to “Not resolved”  before replying.


    Hey Eyal,

    Forgot to give you an update. It worked, but I needed to create a nested shortcode to go along with it. Anyhow, thank you again for your help, the code you wrote and your plugin saved my site!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.