Guest User

Untitled

a guest
Aug 21st, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2. // Do not copy opening PHP tag above
  3. // Add this code to your theme's functions.php file
  4.  
  5. // Add Previous/Next navigation to single listings
  6. add_action( 'genesis_loop', 'wsm_add_listings_navigation' );
  7. function wsm_add_listings_navigation() {
  8.  
  9. // bail if we aren't on a single listing CPT
  10. if ( ! is_singular( 'listing' ) ) {
  11. return;
  12. }
  13.  
  14. // Add the links
  15. echo '<div class="listing-nav previous">';
  16. previous_post_link( '%link', 'Previous Listing' );
  17. echo '</div>';
  18. echo '<div class="listing-nav next">';
  19. next_post_link( '%link', 'Next Listing' );
  20. echo '</div>';
  21.  
  22. }
Add Comment
Please, Sign In to add comment