Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Custom template tags for this theme.
- *
- * Eventually, some of the functionality here could be replaced by core features.
- *
- * @package minimax
- */
- if ( ! function_exists( 'minimax_posts_navigation' ) ) :
- /**
- * Display navigation to next/previous set of posts when applicable.
- *
- * @todo Remove this function when WordPress 4.3 is released.
- */
- function minimax_posts_navigation() {
- // Don't print empty markup if there's only one page.
- if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
- return;
- }
- ?>
- <nav class="navigation paging-navigation" role="navigation">
- <h1 class="sr-only"><?php _e( 'Posts navigation', 'bootstrapwp' ); ?></h1>
- <ul class="pager">
- <?php if ( get_next_posts_link() ) : ?>
- <li class="previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'bootstrapwp' ) ); ?></li>
- <?php endif; ?>
- <?php if ( get_previous_posts_link() ) : ?>
- <li class="next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'bootstrapwp' ) ); ?></li>
- <?php endif; ?>
- </ul><!-- .nav-links -->
- </nav><!-- .navigation -->
- <?php
- }
- endif;
- if ( ! function_exists( 'minimax_post_navigation' ) ) :
- /**
- * Display navigation to next/previous post when applicable.
- *
- * @todo Remove this function when WordPress 4.3 is released.
- */
- function minimax_post_navigation() {
- // 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" role="navigation">
- <h1 class="sr-only"><?php _e( 'Post navigation', 'bootstrapwp' ); ?></h1>
- <ul class="pager">
- <?php
- previous_post_link( '<li class="previous">%link</li>', _x( '<span class="meta-nav">←</span> %title', 'Previous post link', 'bootstrapwp' ) );
- next_post_link( '<li class="next">%link</li>', _x( '%title <span class="meta-nav">→</span>', 'Next post link', 'bootstrapwp' ) );
- ?>
- </ul><!-- .nav-links -->
- </nav><!-- .navigation -->
- <?php
- }
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement