neilgee
1/5/2016 - 2:19 AM

Genesis CPT Navigation Links

Genesis CPT Navigation Links

<?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('&laquo; %link', 'Previous Post'); // Change nav text here
	echo '</div>';

	echo '<div class="pagination-next alignright">';
	next_post_link(' %link &raquo;', 'Next Post'); // Change nav text here
	echo '</div>';

	echo '</div>';

}
<?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();
	echo '</div>';

	echo '<div class="pagination-next alignright">';
	next_post_link();
	echo '</div>';

	echo '</div>';

}

<?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( 'portfolio' ) ) //add your CPT name
		return;
	genesis_markup( array(
		'html5'   => '<div %s>',
		'xhtml'   => '<div class="navigation">',
		'context' => 'adjacent-entry-pagination',
	) );
	echo '<div class="pagination-previous alignleft">';
	previous_post_link();
	echo '</div>';
	echo '<div class="pagination-next alignright">';
	next_post_link();
	echo '</div>';
	echo '</div>';
}