Last active
November 12, 2016 06:37
-
-
Save neilgee/43fdae964113c7e062e8 to your computer and use it in GitHub Desktop.
Genesis CPT Navigation Links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //<~ dont add me in | |
add_action( 'genesis_entry_footer', 'wpb_prev_next_post_nav_cpt' ); | |
function wpb_prev_next_post_nav_cpt() { | |
if ( ! is_singular( array( 'portfolio', 'post' ) ) ) //add your CPT name to the array | |
return; | |
genesis_markup( array( | |
'html5' => '<div %s>', | |
'xhtml' => '<div class="navigation">', | |
'context' => 'adjacent-entry-pagination', | |
) ); | |
echo '<div class="pagination-previous alignleft">'; | |
previous_post_link('« %link', 'Previous Post'); // Change nav text here | |
echo '</div>'; | |
echo '<div class="pagination-next alignright">'; | |
next_post_link(' %link »', 'Next Post'); // Change nav text here | |
echo '</div>'; | |
echo '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment