next_posts_linkとprevious_posts_linkにclassを付ける

「次のページへ」と「前のページへ」を表示する’next_posts_link’と’previous_posts_link’タグ。
そのまま利用するとただのテキストリンクになります。
以下をfunctions.phpに追加することで、aタグにbtnなどのclassを付与することができます。

add_filter('next_posts_link_attributes', 'posts_link_attributes');
add_filter('previous_posts_link_attributes', 'posts_link_attributes');
function posts_link_attributes() {
    return 'class="btn"';
}

参考:Add class to links generated by next_posts_link and previous_posts_link