Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.