You appear to be a bot. Output may be restricted
Description
Display navigation to next/previous post when applicable.
Usage
twentyfourteen_post_nav();
Parameters
Returns
void
Source
File name: twentyfourteen/inc/template-tags.php
Lines:
1 to 25 of 25
function twentyfourteen_post_nav() { // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> <nav class="navigation post-navigation"> <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1> <div class="nav-links"> <?php if ( is_attachment() ) : previous_post_link( '%link', __( '<span class="meta-nav">Published In</span>%title', 'twentyfourteen' ) ); else : previous_post_link( '%link', __( '<span class="meta-nav">Previous Post</span>%title', 'twentyfourteen' ) ); next_post_link( '%link', __( '<span class="meta-nav">Next Post</span>%title', 'twentyfourteen' ) ); endif; ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php }