[wp-hackers] prev/next link metadata

Chris Waigl fz.serendipity at gmail.com
Sat Feb 12 23:18:16 GMT 2005


There are persistent rumours that WP is approaching an important
milestone, so this is maybe the right moment for a request: have the
previous_post() and the next_post() tag, and posts_nav_link() as well
output a rel='next'/'prev' attribute.

Discussion: WP is already very powerful when it comes to semantic
metadata, in particular rel="alternate" and rel="bookmark". This would
be a great addition, at a very low price. More discussion in Firas'
excellent post:
http://www.firasd.org/weblog/2005/01/19/metadata-musings . The W3C
spec is here http://www.w3.org/TR/REC-html40/types.html#type-links .

What: in template-functions-links.php (CVS version downloaded 5
minutes before this was written) replace:

a) line  326, function previous_post()            
$string = '<a href="'.get_permalink($lastpost->ID).'">'.$previous;
is to be replaced with
$string = '<a href="'.get_permalink($lastpost->ID).'" rel="prev">'.$previous;

b) line 364, function next_post()
insert rel="next" the same way

c) i'm not sure if next_post_link() and previous_post_link() are in
active use, if yes, the analogous changes need to go into lines 269
and 289

d) finally, for the paged output, next_posts_link() needs rel="next"
in line 461 and previous_posts_link() rel="prev" in line 481.

There may be other places that generate links for paging, so this may
not be complete.
 
If one of the devs cares enough about this, it would make some ppl happy ;)

Chris 

-- 

Chris Waigl 
blog: http://serendipity.lascribe.net/ 
experiments: http://chrysalidesque.f2o.org


More information about the hackers mailing list