I have a custom post type for events. I output events that have a custom date field that is after today’s date. I’d like to use Ajax Load More to load more events.
Here is my original WP_Query:
$today = strtotime(‘today’);
$query = new WP_Query( array (
‘posts_per_page’ => $no_of_posts,
‘post_type’ => ‘event’,
‘orderby’ => ‘meta_value’,
‘order’ => ‘ASC’,
‘meta_key’ => ‘event-date’,
‘eventCategory’ => $category_name,
‘meta_value’ => $today,
‘meta_compare’ => ‘>=’ )
);
Is there any way to use Ajax Load More with post meta data?
https://wordpress.org/plugins/ajax-load-more/