Skip to content

Instantly share code, notes, and snippets.

@vfontjr
Last active April 29, 2020 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vfontjr/43c9beb61e935b831ee148d1246d1b27 to your computer and use it in GitHub Desktop.
Save vfontjr/43c9beb61e935b831ee148d1246d1b27 to your computer and use it in GitHub Desktop.
<?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