Created
September 16, 2011 14:11
-
-
Save dalethedeveloper/1222205 to your computer and use it in GitHub Desktop.
Implementing rel="next" and rel="prev" on Wordpress
This file contains hidden or 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
/* | |
This will work on WP 2.7.0 on up on the commonly used get_xxxxxxx_posts_link call. | |
From Google: | |
http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html | |
*/ | |
add_filter('next_posts_link_attributes', create_function('$attr','return $attr.\' rel="next" \';')); | |
add_filter('previous_posts_link_attributes', create_function('$attr','return $attr.\' rel="prev" \';') ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment