WordPress Function to Add a custom class to the next and previous links

Add a custom class to the next and previous links

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"';
    }

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *