DocumentationOnline documentation for Ajax Load More
Date Comparison
The code below will query an event post type by comparing the start and end custom field dates.
1 2 3 4 5 6 7 8 9 10 11 |
$start_date = get_field('start_date'); $end_date = get_field('end_date'); echo do_shortcode('[ajax_load_more post_type="event" meta_key="start_date:end_date" meta_value="'. $start_date .':'. $end_date .'" meta_compare=">=:lessthan" meta_type="DATETIME:DATETIME" meta_relation="AND" ]'); |
Note: We are using lessthan in the meta_compare parameter as using a < symbol inside shortcode can cause issues with rendering. This is an undocumented ALM hotfix designed to allow for symbols in shortcodes.