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.
Related Posts:
- Pagination/infinite scroll with WP_Query and multiple loops
- AJAX Breaking Offset Argument In WP Query
- How to pass the current content of $wp_query to a new page?
- WooCommerce | AJAX | Product Pagination | Help me implement Ajax Pagination
- Ajax buttons not working properly in WooCommerce when using wc_get_template_part
- modifying the loop multiple times with arguments passed through ajax to wp_query
- How to solve this script problem in theme directory?
- Sorting Posts Based On Meta Value Using AJAX
- Get post count of current loop when using multiple queries on one page
- Show posts without term
- Display products from specific category in shop page
- get_template_part in for loop
- “pre_get_posts” firing on every query
- Show two random posts from custom post type
- Add the “active” class only to the first loop item in a WordPress query [closed]
- Sort posts by custom taxonomy name
- How to pass custom parameter to WP_Query for filtering in pre_get_posts
- Using AJAX to return search form results
- Foreach-generated custom tax queries, each with an ajax “Load more” button
- cloning a WP_Query
- How to query ‘posts_per_page’ to display a different blog posts index template?
- How is WP_Query connected to WP_Post in The Loop?
- Query sticky posts with thumbnails
- Show all parents and children in custom post type in right order
- Why is this coming back as null? Thats wrong. There is one post
- How to get user_id from wordpress database inside ajax function?
- Ignore post by meta value in the main query
- Update Loop with Form
- How to retrieve current page WP_Query arguments?
- Get posts for last working week in WP_Query
- query user display_name failed in a custom mysql query foreach
- Query posts by specific word on title
- Random loop with code to prevent duplicate output returns no output at all from time to time
- Multiple taxonomy And acf filter group by
- How to use offset in WP_Query
- Reset postdata to custom query in nested queries
- How to Filter Posts by Custom Fields?
- Multiple loops without repeating content
- Filtering posts from different categories into different section by doing WP_Query only once
- Loop Split two Columns
- How to list posts with disabled/closed comments, with pagination?
- How to make a second query offset -2 from current post
- different for loop if screen resolution < 1000px
- Transient api Caches confused
- Best choice for multiple loop in page?
- WP Query – order posts by meta field first and then order the rest
- Wp_query with 2 meta keys and array of meta values
- How to create custom query by keyword in post title?
- Create a loop on my pages with new “WP_Query”
- WP ForLoop to compare meta information of posts to determine what post to display
- How to filter query loop block with a search string from the query parameters
- inserting content of 1 Post to in another with a template hierarchy
- How to use a dropdown to filter posts by custom field
- Different Loop for tag pages?
- Pagination for custom loop on custom page template is not displaying anything
- WP_query is not returning the expected result
- 2 queries with counters
- I need to run a AJAX Fuction from within a WP_Query but only works on first item
- Writing less unnecessary code with WordPress
- Search.php – return number of results but cannot loop through
- Creating ‘posts page’ loop based on the page itself
- Filter subpages in while loop from WP Query object
- How to filter a static post page with ajax and $wp_query
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- Custom query does not find pages
- How to sort by most watched in X days/months
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- How can I use arrays and a foreach to generate many lists with WP_Query?
- How to use custom page for all posts with custom url, call another directory?
- Custom wp_query inside a conditional stament inside a template part doesn’t work: why?
- display ACF repater field in archive page
- Duplice post with standard WP loop – fixed by using query_posts() instead
- WP_Query breaking the loop in a nested loop
- Check the stored / cached WP_Query with transients on post change
- New template file does not load category-specific post
- Filter admin ajax data by url query
- Get categories within specific term
- Custom query for custom post type not getting correct post ID
- Query post with content only
- Load WP Query with Ajax
- update_post_meta() not updating
- Why is my query not giving results?
- Is instantiating WP_Query not possible within an admin Ajax call?
- WordPress conflict with multiple load more posts functions on click
- why default wordpress loop not working outside index.php
- Continue loop after $queryObject
- WP_Query for liked posts is showing all posts if none are liked
- Declare inline background image in functions.php
- custom query – offset to pagination
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- List ALL posts within last week from current category on category page
- Fire query on ajax post url page
- loop through custom post types with meta data
- Using Query In Post Type Archives
- Multiple loops on index page with sticky post and pagination
- tax_query not working properly with get_posts
- the_excerpt() not working in custom archive
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- Prevent WordPress loop from displaying similar post titles
- Custom WordPress loop, articles not in same order as Array