How to Pass WordPress Template Directory Into Ajax URL Call

Can you please let me know how I can pass a template directory instead of

http://localhost:8080/WP/wp-content/themes/twentyseventeen/data.php

into the URL option of an ajax call like below

var request = $.ajax({
type: “POST”,
url: “http://localhost:8080/WP/wp-content/themes/twentyseventeen/data.php”,
cache: false,
dataType: “HTML”,
success: function() {}
});

Read more here:: How to Pass WordPress Template Directory Into Ajax URL Call

Leave a Reply

Your email address will not be published. Required fields are marked *