Skip to content

Instantly share code, notes, and snippets.

@sutter
Created June 6, 2013 13:36
Show Gist options
  • Save sutter/5721523 to your computer and use it in GitHub Desktop.
Save sutter/5721523 to your computer and use it in GitHub Desktop.
Custom next & prev post link
// Add custom class to link NEXT & PREV
function popy_add_class_next_post_link($html){
$html = str_replace('<a','<a class="icon-next"',$html);
return $html;
}
add_filter('next_post_link','popy_add_class_next_post_link',10,1);
function popy_add_class_previous_post_link($html){
$html = str_replace('<a','<a class="icon-prev"',$html);
return $html;
}
add_filter('previous_post_link','popy_add_class_previous_post_link',10,1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment