function showPagination($args = array()) { $args = array_merge(array('offset' => 0, 'id' => 'nav_pages', 'class' => 'nav_pages'), is_array($args) ? $args : (is_int($args) ? array('offset' => $args) : array('id' => $args, 'class' => $args))); // If send string parameter - use it as 'id' and 'class' name global $wp_query; echo "<div id=\"{$args['id']}\" class=\"{$args['class']}\">"; if (function_exists('themerex_wp_pagenavi') && !is_single()) { echo themerex_wp_pagenavi(array('always_show' => 0, 'style' => 1, 'num_pages' => 5, 'num_larger_page_numbers' => 3, 'larger_page_numbers_multiple' => 10, 'pages_text' => __('Page %CURRENT_PAGE% of %TOTAL_PAGES%', 'themerex'), 'current_text' => "%PAGE_NUMBER%", 'page_text' => "%PAGE_NUMBER%", 'first_text' => __('« First', 'themerex'), 'last_text' => __("Last »", 'themerex'), 'next_text' => "»", 'prev_text' => "«", 'dotright_text' => '', 'dotleft_text' => '', 'before' => '', 'after' => '', 'offset' => $args['offset'])); } else { showSinglePageNav('nav-below'); } echo "</div>"; }
function showPagination($args = array()) { $args = array_merge(array('offset' => 0, 'id' => 'pagination', 'class' => 'pagination', 'button_class' => '', 'style' => 'pages', 'show_pages' => 5, 'pages_in_group' => 10, 'pages_text' => '', 'current_text' => "%PAGE_NUMBER%", 'page_text' => "%PAGE_NUMBER%", 'first_text' => __('« First', 'themerex'), 'last_text' => __("Last »", 'themerex'), 'prev_text' => __("«", 'themerex'), 'next_text' => __("»", 'themerex'), 'dot_text' => "…", 'before' => '', 'after' => ''), is_array($args) ? $args : (is_int($args) ? array('offset' => $args) : array('id' => $args, 'class' => $args))); // If send string parameter - use it as 'id' and 'class' name if (empty($args['before'])) { $args['before'] = "<div id=\"{$args['id']}\" class=\"{$args['class']}\">"; } if (empty($args['after'])) { $args['after'] = "</div>"; } if (!is_single()) { showBlogPageNav($args); } else { showSinglePageNav($args); } }