Guest User

Untitled

a guest
Jan 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. <?php
  2. $prev_post = get_previous_post();
  3. $next_post = get_next_post();
  4. ?>
  5.  
  6. <nav class="post-nav section">
  7. <div class="row no-margin">
  8. <?php // Display the thumbnail of the previous post ?>
  9. <div class="col-xs-12 col-sm-6 prev-post" style="padding:0px">
  10. <?php
  11. $prevPost = get_previous_post();
  12. $prevthumbnail = get_the_post_thumbnail($prevPost->ID);
  13. $post_tile=get_the_title($prevPost->ID);
  14. $thumb = wp_get_attachment_image_src(
  15. get_post_thumbnail_id($prevPost->ID), 'full' );
  16. ?>
  17.  
  18. <div class="post-nav-thumb" style="background-image:
  19. url('<?php echo $thumb['0'];?>')" ></div>
  20. <div class="post-nav-content">
  21. <div class="post-nav-subtitle"><?php
  22. previous_post_link('%link', 'Prev Post'); ?></div>
  23. <h2 class="post-nav-title"><span><?php
  24. previous_post_link('%link', $post_tile); ?></span></h2>
  25. </div>
  26.  
  27. </div>
  28.  
  29. <?php // Display the thumbnail of the next post ?>
  30. <div class="col-xs-12 col-sm-6 next-post" style="padding:0px">
  31. <?php
  32. $nextPost = get_next_post();
  33. $nextthumbnail = get_the_post_thumbnail($nextPost->ID);
  34. $post_tile=get_the_title($nextPost->ID);
  35. $thumb = wp_get_attachment_image_src(
  36. get_post_thumbnail_id($nextPost->ID), 'full' );
  37. ?>
  38. <div class="post-nav-thumb" style="background-image:
  39. url('<?php echo $thumb['0'];?>')"></div>
  40. <div class="post-nav-content">
  41. <div class="post-nav-subtitle"><?php next_post_link('%link',
  42. 'Next Post'); ?></div>
  43. <h2 class="post-nav-title"><span><?php
  44. next_post_link('%link', $post_tile); ?></span></h2>
  45. </div>
  46.  
  47. </div>
  48. </div></nav>
  49.  
  50. <div id="primary" class="content-area">
  51. <div id="content" class="site-content" role="main">
  52. <?php
  53. // Start the Loop.
  54. while ( have_posts() ) : the_post(); ?>
  55.  
  56. <?php
  57. get_template_part( 'content', get_post_format() );
  58.  
  59. // Previous/next post navigation.
  60. previous_post_link( '%link', 'Prev post in category', true );
  61. next_post_link( '%link', 'Next post in category', true );
  62.  
  63. // If comments are open or we have at least one comment, load up the comment template.
  64. if ( comments_open() || get_comments_number() ) {
  65. comments_template();
  66. }
  67. endwhile;
  68. ?>
  69. </div><!-- #content -->
  70. </div><!-- #primary -->
Add Comment
Please, Sign In to add comment