'; if($type='all'){ $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( array( 'key' => $event_expire_on, 'value' => $now, 'compare' => $etype ) ) ); $loop = new WP_Query($args); }elseif($type == 'cat'){ $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( array( 'key' => $event_expire_on, 'value' => $now, 'compare' => $etype ) ), 'tax_query' => array( array( 'taxonomy' => 'mep_cat', 'field' => 'term_id', 'terms' => $cat ) ) ); $loop = new WP_Query($args); }elseif($type == 'org'){ $args = array( 'post_type' => array('mep_events'), 'posts_per_page' => $show, 'paged' => $paged, 'order' => $sort, 'orderby' => 'meta_value', 'meta_key' => 'event_start_datetime', 'meta_query' => array( array( 'key' => $event_expire_on, 'value' => $now, 'compare' => $etype ) ), 'tax_query' => array( array( 'taxonomy' => 'mep_org', 'field' => 'term_id', 'terms' => $org ) ) ); $loop = new WP_Query($args); } return $loop; } function mep_event_pagination($total_page){ $paged = get_query_var("paged") ? get_query_var("paged") : 1; ?>
$paged, "total" => $total_page ); echo "
" . paginate_links($pargs) . "
"; ?>