pablocattaneo
4/14/2016 - 2:33 AM

Add Css class to previous_posts_link() and next_posts_link() to add pagination. Add to function.php Source: https://css-tricks.com/snippets

Add Css class to previous_posts_link() and next_posts_link() to add pagination. Add to function.php

Source: https://css-tricks.com/snippets/wordpress/add-class-to-links-generated-by-next_posts_link-and-previous_posts_link/

<?php
/*Add css class to older post and newer post used in the previous_posts_link() and next_posts_link() functions*/
add_filter('previous_posts_link_attributes', 'older_posts');
add_filter('next_posts_link_attributes', 'newer_posts');

function newer_posts() {
    return 'class="newer_posts"';
}
function older_posts() {
    return 'class="older_posts"';
}
?>