Skip to content

Instantly share code, notes, and snippets.

@netmagik
Last active May 8, 2019 16:17
Show Gist options
  • Save netmagik/787804ecd48f1631734f to your computer and use it in GitHub Desktop.
Save netmagik/787804ecd48f1631734f to your computer and use it in GitHub Desktop.
How to add Previous/Next links on single pages of custom post type in Genesis
/** Genesis Previous/Next Post Post Navigation */
add_action( 'genesis_after_entry', 'custom_prev_next_post_nav' );
function custom_prev_next_post_nav() {
if ( ! is_singular( 'portfolio' ) ) return;
echo '<div id="prev-next">';
previous_post_link( '<div class="prev-link"> %link</div>', '<span>&larr;</span>%title' );
next_post_link( '<div class="next-link"> %link</div>', '%title<span>&rarr;</span>' );
echo '</div><!-- .prev-next-navigation -->';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment