Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
add_post_type_support( 'post', 'my-custom-prev-next-post-nav' );
add_action( 'genesis_after_entry', 'my_custom_prev_next_post_nav' );
function my_custom_prev_next_post_nav() {
if ( ! is_singular() || ! post_type_supports( get_post_type(), 'my-custom-prev-next-post-nav' ) ) {
return;
}
genesis_markup( array(
'open' => '<div %s>',
'context' => 'adjacent-entry-pagination',
) );
echo '<div class="pagination-previous alignleft">';
previous_post_link( '%link', '&laquo; Previous Page' );
echo '</div>';
echo '<div class="pagination-next alignright">';
next_post_link( '%link', 'Next Page &raquo;' );
echo '</div>';
genesis_markup( array(
'close' => '</div>',
'context' => 'adjacent-entry-pagination',
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment