catchresponsive_post_navigation

Displays Single post Navigation.

Description

catchresponsive_post_navigation(); 

Usage

  1. if ( !function_exists( 'catchresponsive_post_navigation' ) ) { 
  2. require_once '/inc/catchresponsive-core.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = catchresponsive_post_navigation(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/catchresponsive-core.php  
  1. function catchresponsive_post_navigation() { 
  2. // Previous/next post navigation. 
  3. if ( function_exists( 'the_post_navigation' ) ) { 
  4. the_post_navigation( array( 
  5. 'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next →', 'catch-responsive' ) . '</span> ' . 
  6. '<span class="screen-reader-text">' . __( 'Next post:', 'catch-responsive' ) . '</span> ' . 
  7. '<span class="post-title">%title</span>',  
  8. 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( '← Previous', 'catch-responsive' ) . '</span> ' . 
  9. '<span class="screen-reader-text">' . __( 'Previous post:', 'catch-responsive' ) . '</span> ' . 
  10. '<span class="post-title">%title</span>',  
  11. ) ); 
  12. else { 
  13. // Don't print empty markup if there's nowhere to navigate. 
  14. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); 
  15. $next = get_adjacent_post( false, '', false ); 
  16.  
  17. if ( ! $next && ! $previous ) { 
  18. return; 
  19. ?> 
  20. <nav class="navigation post-navigation" role="navigation"> 
  21. <h2 class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'catch-responsive' ); ?></h2> 
  22. <div class="nav-links"> 
  23. <?php 
  24. previous_post_link( '<div class="nav-previous">%link</div>', '%title' ); 
  25. next_post_link( '<div class="nav-next">%link</div>', '%title' ); 
  26. ?> 
  27. </div><!-- .nav-links --> 
  28. </nav><!-- .navigation --> 
  29. <?php