Last active
September 14, 2017 12:28
-
-
Save d8vjork/84e2f1c1e10a5f66c88b2587777aabf0 to your computer and use it in GitHub Desktop.
Customize link attributes of WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add this in your functions.php | |
*/ | |
add_filter('next_post_link', 'post_link_attributes'); | |
add_filter('previous_post_link', 'post_link_attributes'); | |
function post_link_attributes($output) { | |
$injection = 'class="styled-button"'; | |
return str_replace('<a href=', '<a '.$injection.' href=', $output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment