Adding a class to the “Next” and “Previous” links that WordPress places at the bottom of each post is quite easy.

Just add the following code to your functions.php (don’t forget to customize the class attribute (see line 5) with your own CSS settings).

add_filter('next_post_link', 'post_link_attributes');
add_filter('previous_post_link', 'post_link_attributes');
function post_link_attributes($output) {
    $code = 'class="styled-button"';
    return str_replace('<a href=', '<a '.$code.' href=', $output);
Add class to links generated by WordPress “next_post_link” and “previous_post_link” functions


One more thing

As an alternate way to proceed, with a few CSS lines, you should also be able to target the prev and next REL attributes that Wordpress programmatically adds to the appropriate anchors.

a[rel="prev"] { }

a[rel="next"] { }
Target rel attribute of prev and next