'; $cat_filter = !empty($cat) ? array( 'taxonomy' => 'mep_cat', 'field' => 'term_id', 'terms' => $cat ) : ''; $org_filter = !empty($org) ? array( 'taxonomy' => 'mep_org', 'field' => 'term_id', 'terms' => $org ) : ''; $city_filter = !empty($city) ? array( 'key' => 'mep_city', 'value' => $city, 'compare' => 'LIKE' ) : ''; $country_filter = !empty($country) ? array( 'key' => 'mep_country', 'value' => $country, 'compare' => 'LIKE' ) : ''; $expire_filter = !empty($event_expire_on) ? array( 'key' => $event_expire_on, 'value' => $now, 'compare' => $etype ) : ''; $args = array( 'post_type' => array('mep_events'), 'paged' => $paged, 'posts_per_page' => $show, 'order' => $sort, 'orderby' => 'meta_value', 'meta_key' => 'event_start_datetime', 'meta_query' => array( $expire_filter, $city_filter, $country_filter ), 'tax_query' => array( $cat_filter, $org_filter ) ); $loop = new WP_Query($args); return $loop; } /** * This is the Main Function For Pagination the Event List, Just Pass the Required values It will return the Pagination with HTML */ function mep_event_pagination($total_page) { $paged = get_query_var("paged") ? get_query_var("paged") : 1; ?>