Ajax Infinite Scroll In Custom WP_Query Loop Not Working

Do you have a https version of your website ?
I ask this because I recently came across a project which was a website which could be reached both in http and https. Thus I had to specify it to the ajax_url function. So, in your case, I suggest you try:

$protocol = isset( $_SERVER['HTTPS'] ) ? 'https://' : 'http://';

$args = array(
  'ajaxurl' => admin_url( 'admin-ajax.php',$protocol ),
  'query'   => $wp_query->query

in your enqueue function.

Leave a Comment