Ajax call undefined index

There are 2 problems: Problem 1 Your AJAX endpoint looks for my_id: $id = $_POST[‘my_id’]; But your javascript sends id: id : my_id Importantly: id != my_id They do not match. There is no $_POST[‘my_id’], that’s why you get a PHP notice Problem 2 You’re using $_POST but the code does not make a POST … Read more

Ajax filter with loadmore button

You could possibly look at doing this the same way that WP Job Manager does: https://github.com/Automattic/WP-Job-Manager/blob/master/assets/js/ajax-filters.js This is done by triggering a handler to make the query defining what “page” the query should run against. I would recommend using that as an example to build off of, as it works with both filters applied and … Read more