1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

Previous and Next Post Navigation in Genesis WordPress

previous and next post navigation in genesis

If you are on the genesis system and want to have previous and next post navigation you can add the code below to your functions.php file. This is a great way for people to navigate though the posts on your website.

 

/** Genesis Previous/Next Post Post Navigation */

add_action( 'genesis_before_comments', 'eo_prev_next_post_nav' );
 
function eo_prev_next_post_nav() {
  
	if ( is_single() ) {
 
		echo '
<div class="prev-next-navigation">';
		previous_post_link( '
<div class="previous">Previous article: %link</div>

', '%title' );
		next_post_link( '
<div class="next">Next article: %link</div>

', '%title' );
		echo '</div>

<!-- .prev-next-navigation -->';
 
	}
 
}

In your style sheet you can style the buttons how you like *

Here is an example. You can add this to your style.css in your child theme.

.prev-next-navigation {
  margin: 20px 0;
	clear: both;
	overflow: hidden;
}

.previous {
	float: left;
	width: 50%;
}

.next {
	float: right;
	text-align: right;
	width: 50%;
}

Reference: http://www.eugenoprea.com/code-snippets/genesis-how-to-add-previousnext-post-navigation/

Please follow and like us:
Previous and Next Post Navigation in Genesis WordPress was last modified: June 3rd, 2016 by Maximus Mccullough

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.