max_num_pages <= 1) { return; } $big = 999999999; $links = paginate_links([ 'base' => str_replace((string) $big, '%#%', esc_url(get_pagenum_link((string) $big))), 'format' => '?paged=%#%', 'current' => max(1, (int) get_query_var('paged', 1)), 'total' => (int) $query->max_num_pages, 'prev_text' => is_rtl() ? esc_html__('Next', 'xshop') : esc_html__('Previous', 'xshop'), 'next_text' => is_rtl() ? esc_html__('Previous', 'xshop') : esc_html__('Next', 'xshop'), 'type' => 'array', 'mid_size' => 1, 'end_size' => 1, ]); if (empty($links) || !is_array($links)) { return; } ?>