Skip to content

Instantly share code, notes, and snippets.

@hsleonis
Created February 7, 2016 07:05
Show Gist options
  • Save hsleonis/16c3b8414d83cbbbb2f6 to your computer and use it in GitHub Desktop.
Save hsleonis/16c3b8414d83cbbbb2f6 to your computer and use it in GitHub Desktop.
Used on single post permalink pages, this template tag displays a link to the previous post which exists in chronological order from the current post.
<?php
/*
previous_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' );
*/
previous_post_link('%link', 'Previous in category', TRUE, '12');
previous_post_link( '%link', 'Previous post in category', TRUE, ' ', 'post_format' );
// Using font-awesome icon in link custom buttom
previous_post_link( '%link', '<i class="sprite sprite-left-arrow"></i>', TRUE, ' ', 'status' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment