Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Do not copy opening PHP tag above
- // Add this code to your theme's functions.php file
- // Add Previous/Next navigation to single listings
- add_action( 'genesis_loop', 'wsm_add_listings_navigation' );
- function wsm_add_listings_navigation() {
- // bail if we aren't on a single listing CPT
- if ( ! is_singular( 'listing' ) ) {
- return;
- }
- // Add the links
- echo '<div class="listing-nav previous">';
- previous_post_link( '%link', 'Previous Listing' );
- echo '</div>';
- echo '<div class="listing-nav next">';
- next_post_link( '%link', 'Next Listing' );
- echo '</div>';
- }
Add Comment
Please, Sign In to add comment