Okay
  Public Ticket #3486194
Leaflet map plugin not working after ajax load
Closed

Comments

  •  1
    Jorge started the conversation

    Hello, first of all thank you for this theme.

    The problem is that when I access the following page (https://aureus.studio/lifestyle/ride-01/) from the web menu, the Leaflet Maps plugin shortcode does not load. If I directly access the mentioned page it works perfectly. For this reason I think there is some conflict with this plugin when accessing the page using Ajax. I would be extremely grateful if you could help me.

    Thank you very much for your time

    Attached files:  Captura de pantalla 2023-09-26 150035.png
      Captura de pantalla 2023-09-26 145955.png

  •  1,973
    Support replied

    Hello Jorge,

    Your assumption is correct.

    We cannot guarantee any of the third party elements/plugins working w/ AJAX

    CSS styles are usually loaded in the header of the page, dynamic js effects in the footer.

    When a page is loaded with ajax header and footer stay the same (the original starting page), the content is loaded in an inner container.

    We recommend using our shortcodes/Gutenberg blocks/Elementor widgets that are guaranteed to work with ajax. Or disable ajax in customizer -> general settings. You can also keep the ajax on and add the page containing the elements as custom menu link therefore bypassing ajax. Plz try that.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  1
    Jorge replied

    ok, for now I am going to opt for the option of using a custom menu link.

    In my mind I have a solution but I don't know if it could work, the idea would be to create a function in functions.php of my child theme that is executed every time the ajax load is performed. In this function the necessary scripts and styles (wp_enqueue_script and wp_enqueue_style) would be registered, previously checking that they have not already been loaded. If I am right in what I say, I would like to know the name of the action hook that is executed on each ajax page load in your theme.

    Thanks

  •  1,973
    Support replied

    Hello Jorge,

    if you know which files need to be enqueued to can add them in the child theme following the examples in /include/scripts-config.php functions wp_enqueue_script and wp_enqueue_style

    and you can add the files in the child theme in an action function for the wp_enqueue_scripts filter

    https://prnt.sc/I9PwKA4GkrGC

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  1
    Jorge replied

    ok, thank you so much. i will try and update this ticket.