post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; } if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) return; $nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation'; if ( is_single() ) { // navigation links for single posts ?> max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) { // navigation links for home, archive, and search pages ?> found_posts / $pp ); if ($total<=1) return ''; preg_match('/([^ ]+)([^a-z])page(\/|d=)([0-9]+)([^ ]{0,})$/', get_next_posts_page_link(), $res); $current= ($res[4]==1 || $res[4]=='' || $res[4]==0)?1:($res[4]-1); $links = paginate_links( array( 'show_all' => false, 'total'=> $total , 'current' => $current, 'base'=> $res[1].'%_%', 'format' => $res[2] . 'page' . $res[3] . '%#%' . $res[5], 'prev_next' => true, 'end_size' => 2, 'mid_size' => 2, 'prev_text' => '', 'next_text' => '', 'type' => 'array', ) ); foreach ($links as $i => $link) { $active = strpos($link, 'span') == 1 && !strpos($link, '"page-numbers dots"') ? ' class="active"' : ''; $links[$i] = '