Previous and Next Post Navigation in Genesis WordPress

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.

 

[code]/** Genesis Previous/Next Post Post Navigation */

add_action( ‘genesis_before_comments’, ‘eo_prev_next_post_nav’ );

Only cool people share!

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 –>’;

}

}[/code]

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.

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

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

.next {
float: right;
text-align: right;
width: 50%;
}[/code]

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

Previous and Next Post Navigation in Genesis WordPress was last modified: June 3rd, 2016 by Maximus Mccullough
previous and next post navigation in genesis

Leave a Reply

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