Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. <!-- Single Next/Last Post nav
  2. ================================================== -->
  3. <section class="sect-posts post-nav cf">
  4.  
  5. <?php $prevPost = get_previous_post(true);
  6. if($prevPost) {
  7. $args = array(
  8. 'posts_per_page' => 1,
  9. 'include' => $prevPost->ID
  10. );
  11. $prevPost = get_posts($args);
  12. foreach ($prevPost as $post) {
  13. setup_postdata($post);
  14. ?>
  15. <article class="g-6 cols" style="background-image:url('<?php echo catch_that_image($page->ID, 'fullsize') ?>');">
  16. <a href="<? the_permalink()?>" style="background-image:url('<?php echo catch_that_image($page->ID, 'fullsize') ?>');">
  17. <div class="content">
  18. <!--<small class="meta-date"><?php the_time('F j, Y'); ?></small>-->
  19. <small class="meta-date">Last Post</small>
  20. <hr class="sep"/>
  21. <h3><?php the_title_shorten(45,'...'); ?></h3>
  22. </div>
  23. <div class="overlay"></div>
  24. </a>
  25. </article>
  26. <?php
  27. wp_reset_postdata();
  28. } //end foreach
  29. } // end if
  30.  
  31. $nextPost = get_next_post(true);
  32. if($nextPost) {
  33. $args = array(
  34. 'posts_per_page' => 1,
  35. 'include' => $nextPost->ID
  36. );
  37. $nextPost = get_posts($args);
  38. foreach ($nextPost as $post) {
  39. setup_postdata($post);
  40. ?>
  41. <article class="g-6 cols" style="background-image:url('<?php echo catch_that_image() ?>');">
  42. <a href="<? the_permalink()?>" style="background-image:url('<?php echo catch_that_image() ?>');">
  43. <div class="content">
  44. <!--<small class="meta-date"><?php the_time('F j, Y'); ?></small>-->
  45. <small class="meta-date">Next Post</small>
  46. <hr class="sep"/>
  47. <h3><?php the_title_shorten(45,'...'); ?></h3>
  48. </div>
  49. <div class="overlay"></div>
  50. </a>
  51. </article>
  52. <?php
  53. wp_reset_postdata();
  54. } //end foreach
  55. } // end if
  56. ?>
  57.  
  58. </section><!-- .navigation -->
  59.  
  60. <?php endwhile; // End the loop ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement