query_vars['paged'] > 1 ? $current = esc_html($wp_query->query_vars['paged']) : $current = 1; if (get_option('permalink_structure') != '' && !is_page_template('../templates/search-property.php')) { $format = 'page/%#%'; $base = get_pagenum_link(1) . '%_%'; $args = false; } else { $format = ((!empty($_SERVER['QUERY_STRING']) && !array_key_exists('paged', $_GET)) ? '&paged=%#%' : '?paged=%#%'); $base = get_pagenum_link(1) . '%_%'; $args = false; } $pagination = array( 'base' => $base, 'format' => $format, 'total' => $wp_query->max_num_pages, 'current' => $current, 'prev_text' => '', 'next_text' => '', 'show_all' => true, 'type' => 'list', 'add_args' => $args, 'before_page_number' => '', 'after_page_number' => '' ); $pagination_links = paginate_links($pagination); if ($pagination_links != null) { echo '