duskosobic
1/25/2017 - 2:36 PM

Add class to links generated by next_posts_link and previous_posts_link. These two functions create anchor links, and you can customize a lo

Add class to links generated by next_posts_link and previous_posts_link. These two functions create anchor links, and you can customize a lot of it, but it's impossible to add a class through just using their parameters alone. Gotta add a function to functions.php:

<?php

add_filter('next_posts_link_attributes', 'posts_link_attributes');
add_filter('previous_posts_link_attributes', 'posts_link_attributes');

function posts_link_attributes() {
    return 'class="styled-button"';
}

?>