Skip to content

Instantly share code, notes, and snippets.

@SiGaCode
Last active January 9, 2017 11:22
Show Gist options
  • Select an option

  • Save SiGaCode/909f08a2db3c9c62d24f to your computer and use it in GitHub Desktop.

Select an option

Save SiGaCode/909f08a2db3c9c62d24f to your computer and use it in GitHub Desktop.
Genesis Previous/Next Post Post Navigation for articles, single view Credits: http://www.eugenoprea.com/code-snippets/genesis-how-to-add-previousnext-post-navigation/ HTML arrows here: http://character-code.com/arrows-html-codes.php
/** 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">&#10094; %link</div>', '%title' );
next_post_link( '<div class="next">%link &#10095;</div>', '%title' );
echo '</div><div class="clearfix"></div><!-- .prev-next-navigation -->';
}
}
/* Adjust to your liking! */
.prev-next-navigation {
margin: 20px 0;
clear: both;
overflow: hidden;
}
.previous, .next, .previous a, .next a {
background:#0C4866;
color:#fff;
padding: 15px;
}
.previous {
float: left;
width: auto;
}
.next {
float: right;
text-align: right;
width: auto;
}
/* Adjust max-width to fit your break-points! */
@media only screen and (max-width: 640px) {
.previous, .next {
float:none;
width:100%;
text-align:center;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment