diff --git a/archive.php b/archive.php index ebf0084a..ea798ace 100644 --- a/archive.php +++ b/archive.php @@ -87,7 +87,7 @@ get_header(); ?> - + diff --git a/inc/template-tags.php b/inc/template-tags.php index 4843de7b..128a4790 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -7,55 +7,63 @@ * @package _s */ -if ( ! function_exists( '_s_content_nav' ) ) : +if ( ! function_exists( '_s_paging_nav' ) ) : /** - * Display navigation to next/previous pages when applicable. + * Display navigation to next/previous set of posts when applicable. + * + * @return void */ -function _s_content_nav( $nav_id ) { - global $wp_query, $post; - - // Don't print empty markup on single pages if there's nowhere to navigate. - if ( is_single() ) { - $previous = ( is_attachment() ) ? get_post( $post->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() ) ) { +function _s_paging_nav() { + // Don't print empty markup if there's only one page. + if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { return; } - - $nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation'; - ?> - post_parent ) : get_adjacent_post( false, '', true ); + $next = get_adjacent_post( false, '', false ); + + if ( ! $next && ! $previous ) { + return; + } + ?> + + - + diff --git a/search.php b/search.php index 1840677f..22acf0d1 100644 --- a/search.php +++ b/search.php @@ -23,7 +23,7 @@ get_header(); ?> - + diff --git a/single.php b/single.php index 63347ea6..0fc8d5d9 100644 --- a/single.php +++ b/single.php @@ -14,7 +14,7 @@ get_header(); ?> - +