Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. if ( ! function_exists( 'mm_post_nav' ) ) :
  2. /**
  3. * Displays navigation to next/previous post when applicable.
  4. *
  5. * @since 1.0
  6. *
  7. * @return void
  8. */
  9. function mm_post_nav() {
  10. global $post;
  11.  
  12. // Don't print empty markup if there's nowhere to navigate.
  13. $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
  14. $next = get_adjacent_post( false, '', false );
  15. $prevpost = get_previous_post(true);
  16. $prevThumbnail = get_the_post_thumbnail($prevpost->ID, array(44,44) );
  17. $nextpost = get_next_post(true);
  18. $nextThumbnail = get_the_post_thumbnail($nextpost->ID, array(44,44) );
  19. if ( ! $next && ! $previous )
  20. return;
  21. ?>
  22. <nav class="mm-post-nav" role="navigation">
  23. <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'mm-cube' ); ?></h1>
  24. <div class="mm-single-nav">
  25. <div class="mm-prev-link">
  26.  
  27. <?php previous_post_link( '%link', _x( '<i class="icon-chevron-left"></i><span class="mm-prev-post-title"> %title</span>', 'Previous post link', 'mm-cube' ) ); ?>
  28. </div>
  29. <div class="mm-next-link">
  30.  
  31. <?php next_post_link( '%link', _x( '<span class="mm-next-post-title">%title</span><i class="icon-chevron-right"></i>' , 'Next post link', 'mm-cube' ) ); ?>
  32.  
  33. </div>
  34. </div><!-- .nav-links -->
  35. <div class="clear"></div>
  36. </nav><!-- .navigation -->
  37. <?php
  38. }
  39. endif;
  40.  
  41. string(0) ""
  42.  
  43. $prevpost = get_previous_post(true);
  44. if (!empty( $prevpost )) {
  45. $prevThumbnail = get_the_post_thumbnail($prevpost->ID, array(44,44) );
  46. }
  47. $nextpost = get_next_post(true);
  48. if (!empty( $nextpost )) {
  49. $nextThumbnail = get_the_post_thumbnail($nextpost->ID, array(44,44) );
  50. }
  51.  
  52. previous_post_link( $format, $link, $in_same_cat = false, $excluded_terms = '', $taxonomy = 'category' );
  53.  
  54. previous_post_link( '%link', _x( '<i class="icon-chevron-left"></i><span class="mm-prev-post-title">%title</span>', FALSE, 'mm-cube' ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement