post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; } // Don't print empty markup in archives if there's only one page. if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) return; $nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation'; ?> max_num_pages; } else { $total = $max_num_pages; } // need an unlikely integer $big = 999999999; // Make sure paging works if ( get_query_var( 'paged' ) ) { $paged = get_query_var( 'paged' ); } elseif ( get_query_var( 'page' ) ) { $paged = get_query_var( 'page' ); } else { $paged = 1; } $args = array( 'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ), 'format' => '?paged=%#%', 'current' => max( 1, $paged ), 'total' => $total, 'mid_size' => 4, 'prev_text' => '← ' . __( 'Previous', 'delighted' ), 'next_text' => __( 'Next', 'delighted' ) . ' →', 'type' => 'list' ); $pagination = apply_filters( 'delighted_pagination_args', paginate_links( $args ) ); if( empty( $pagination ) ) return; // Create pagination output $pagination = '