• Resolved David 279

    (@david-279)


    Hi Patrick,

    Do you know of any way to call the location map (singular for one location) by shortcode or other means ?

    My problem is I am using Elementor to get some nice layout on my pages, now I can use elementor within Events Manager to format my pages, but all of that formatting is effectively switched off by the default formatting within Events Manager, I can switch events manager formatting off by setting Override with Formats (events manager page settings) to No, but if I do that it removes the location map from my location pages, if I leave it to yes then my page formatting is rubbish ??

    P.S I know I can use [locations_map post_id=”xxxx”] but that means I need to set it for each and every location and I have quite a lot LOL

    • This topic was modified 5 years, 6 months ago by David 279.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    Disabling EM Formatting will stop processing of all placeholders, because EM is then told to step aside. I do not use am editor myself, but I read a lot of users do.

    It still is best to let EM work its magic. The great benefit of EM is that it uses shortcodes and placeholders and lets you style it 100% to your liking.

    If you like the the Elementor layout, simply copy that mark-up (page source code) to the EM formatting settings and turn EM formatting back on. Sort of saying: “Thank you, Elementor. I will now not use you.” LOL. ??

    To display only one location, please do not use the multiple locations shortcode. That triggers a lot more code, slowing WP. Use:
    [location post_id="37"]#_LOCATIONMAP[/location]

    Especially with the new version of EM OSM coming up: locations_map will always use the default map tiles, while #_LOCATIONMAP can be customized. ??

    Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    If you really want to keep Elementor leading, you could also create your own custom shortcode.

    Assuming you are still using the EM created custom post type page, but not letting EM do its thing:

    To display the location map in the Single Location Page, use [elementor_single_location]

    function elementor_single_location() {
      global $post;
      $EM_Location = new EM_Location($post->ID, 'post_id');
      $OSM_Map = $EM_Location->output("#_LOCATIONMAP");
      return $OSM_Map;
    }
    add_shortcode('elementor_single_location', 'elementor_single_location');

    To display the location map in the Single Event Page, use [elementor_event_location]

    function elementor_event_location() {
      global $post;
      $EM_Event 	= new EM_Event($post->ID, 'post_id');
      $OSM_Map 	= $EM_Event->output("#_LOCATIONMAP");
      return $OSM_Map;
    }
    add_shortcode('elementor_event_location', 'elementor_event_location');
    Thread Starter David 279

    (@david-279)

    Brilliant ! Perfect thank you ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Showing the Location Map’ is closed to new replies.