• <script type="text/javascript">
            var ajaxurl = 'https://WEBSITE.TLD/wp-admin/admin-ajax.php';
        </script>

    Why do you use this code in the front end of the website ? This is in a incognito browser window and not logged in. Strange that you need a file from the admin backend.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hi j,

    That file is used for the front end as well… It’s what controls/allows AJAX requests, including on the front end.

    https://dev.to/shwetadanej/ajax-calls-in-wordpress-front-end-2g09

    That line is just adding the URL for the AJAX requests, so that things like getting the available time slots for a given date is available on the front-end.

    • This reply was modified 3 years, 3 months ago by jaysupport.
    Thread Starter jseutens

    (@jseutens)

    ok but can you not load it in the middle of the page and load it in the footer like on the link you posted?

    Plugin Support jaysupport

    (@jaysupport)

    Thanks for the suggestion. We’ll run some tests with that in mind and include any necessary modifications to this in a future update.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘admin-ajax.php in frontend’ is closed to new replies.