Infinite Maximum pages
-
Hello,
I am using your plugin to load 20 events per scroll from Events Calendar Plugin and I customized the display to filter out the passed events. Unfortunately, when I customized it seems there is a maximum of 2 pages only. Meaning only 40 events were loaded. Is there a way to set the maximum pages to infinite?
I tried every possible code like max_num_page set to 0 but not working. Please help!
This is the code I wrote to filter out passed events:
function upcoming_event($args) {
$date_today = date(‘Y-m-d’);
$date_cutoff = date(‘Y-m-d’, strtotime($date_today . ‘ -1 days’));$now = new DateTime();
$end = $now->format( ‘Y-m-d H:i:s’ );
$begin = $now->modify( ‘-10 days’ )->format( ‘Y-m-d H:i:s’ );if ($_GET[‘page’] == ‘0’) {
$offset = ”;
} else {
$offset = $_GET[‘page’];
}$args = [
‘post_status’ => ‘publish’,
‘post_type’ => array(TribeEvents::POSTTYPE),
‘posts_per_page’ => 20,
‘meta_key’ => ‘_EventStartDate’,
‘orderby’ => ‘_EventStartDate’,
‘order’ => ‘ASC’,
‘eventDisplay’ => ‘custom’,
‘offset’ => $offset,
‘meta_query’ => [
‘key’ => ‘_EventEndDate’,
‘value’ => $date_today,
‘compare’ => ‘>=’,
‘type’ => ‘DATE’
]
];return $args;
} add_filter(‘alm_query_args_upcoming_event’, ‘upcoming_event’);
- The topic ‘Infinite Maximum pages’ is closed to new replies.