Skip to content

Instantly share code, notes, and snippets.

@dalethedeveloper
Created September 16, 2011 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalethedeveloper/1222205 to your computer and use it in GitHub Desktop.
Save dalethedeveloper/1222205 to your computer and use it in GitHub Desktop.
Implementing rel="next" and rel="prev" on Wordpress
/*
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