usually it because you are missing an “add_action” call for none logged in users.
add this to your plugin or functions.php
add_action('wp_ajax_nopriv_REPLACETHIS', 'ajax_get_date_post');
and change the REPLACETHIS to your action value from the ajax call.
remember that when calling ajax from front-end and you want to allow none logged in users
to make these calls you allways add both:
add_action('wp_ajax_my_action', 'my_action_callback');
add_action('wp_ajax_nopriv_my_action', 'my_action_callback');
you can read about more at the codex
Related Posts:
- Fire query on ajax post url page
- How to print the excuted sql right after its execution
- Return only Count from a wp_query request?
- wp_query->max_num_pages always returns 0 on custom post type
- Is it true $wpdb->get_results is faster than WP_Query in most cases?
- ajax category filter
- next_posts_link not working for loop called with ajax
- Use WP_Query with a custom SQL query
- Load more AJAX on WP Query
- How to make an activities stream mixing posts and comments?
- How to pass custom parameter to WP_Query for filtering in pre_get_posts
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- ‘posts_where’ filter not applying ‘WP_Query’ in `wp_ajax`
- Using AJAX to return search form results
- Foreach-generated custom tax queries, each with an ajax “Load more” button
- How to wp_query posts with ajax
- Should close $wpdb via $wpdb->close()
- How to get user_id from wordpress database inside ajax function?
- Update Loop with Form
- WP_Query & AJAX
- Sticky Post default functionality with WP_Query is ignored when using AJAX
- How would I format a query that depends on post parent taxonomy
- Mysql query LIKE not working
- How to correctly pass values to wpdb->prepare()?
- What’s the purpose / logic of split_the_query in WP_Query->get_posts
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- Using Ajax to load more posts | Help me change the wording on my button to notify the user
- Include custom field in Ajax search WordPress
- Custom Query num_rows returns wrong amount
- Getting post revision and printing them on the post content site
- Filtering posts from different categories into different section by doing WP_Query only once
- Iterating through $wpdb query without using get_results for large query results
- how to handle multiple ajax wordpress queries?
- Query with search and subscribers only output
- wp_Qwery works to slow
- How to query custom post types with mixed AND & OR statements for custom fields
- Query most popular terms by taxonomy over 2 week period
- Filter wordpress post categories with jquery/ajax and pagination?
- Which is faster wpdb & get_row or wp_query & ge_post_meta?
- How to pass orderby params to $wpdb->prepare()?
- Is it safe to access the underlying mysqli object from \wpdb for custom queries?
- Make a SQL query with wpdb in WordPress
- List of ways to access WordPress database?
- Specify strict ‘order by’ in WordPress query
- Use Ajax To filter posts?
- Does WordPress have something like Drupal’s DB API?
- Change AJAX filter from POST to GET for URL Parameters
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- Apply filters to main query instead of creating new one?
- How to use a dropdown to filter posts by custom field
- WP_query is not returning the expected result
- WordPress dynamic AJAX query
- ajax wp_query conditional tags not working
- I need to run a AJAX Fuction from within a WP_Query but only works on first item
- Add AJAX “Load more” on custom query block
- get_var is neither a string, integer, or array …?
- 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
- how to translate countries output from wp database?
- wpquery via ajax
- Ajax (jquery) wp_query pagination returns -1
- What’s wrong with this wpdb query?
- Save queried result into database
- Any way to use FETCH_KEY_PAIR with $wpdb?
- WordPress live search and filter
- Filter admin ajax data by url query
- Move some posts to end of sort order, even if there is a sort in the wp_Query already
- How to get user avatar via WPDB
- Ajax buttons not working properly in WooCommerce when using wc_get_template_part
- Load WP Query with Ajax
- remove_action – pre_get_posts – does not restore original query
- Order & Orderby clause not working with custom query
- Is instantiating WP_Query not possible within an admin Ajax call?
- WordPress conflict with multiple load more posts functions on click
- Search Filter With Custom Taxonomy and Custom Fields : How do I handle it via plugin?
- What argument does my function need to echo get_results() query results
- modifying the loop multiple times with arguments passed through ajax to wp_query
- complex query question
- Select Unique Posts for a List of Tags
- How To Use WP_Query To Get The Custom Post type Posts With Keywords
- WP_Query for liked posts is showing all posts if none are liked
- Declare inline background image in functions.php
- How to get query results for the next page
- How to solve this script problem in theme directory?
- I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views
- WordPress WP_Query offset parameter not working with search parameter
- Why is $wp_query fetching nothing?
- Sorting Posts Based On Meta Value Using AJAX
- Custom query (author is post_author or meta co_author) with Pagenavi pagination
- WP_Query search by multiple meta key and distance
- Different sql queries count indicator on the main page [closed]
- Convert a WP Query into a simpler SQL query to fetch only COUNT of posts
- Duplicate posts showing up in loop using infinite scroll
- Adding arguments to WooCommerce Product Loop using AJAX
- Refresh wp_query with no changes
- get_post_meta bringing back results, but $wpdb->postmeta doesn’t
- WordPress WP_User_Query ignores the `meta_query` when called from an Ajax function
- AJAX multiple search boxes not merging with array merge
- How to use wp-query to search for posts where post_content OR post_title OR post_name
- WordPress DB query