[wp-hackers] Alternate paging URLs
dan at phiffer.org
Wed Mar 3 04:06:11 UTC 2010
I don't like the URL structure /page/2/ for two reasons:
- Its content changes, making it not very bookmark-friendly (or search results friendly)
- It contains a path that isn't valid, /page/
I'd prefer to use ?start=key, where key is a URL slug or ID number. I've worked out some SQL that I think will do what I want, but I don't know how difficult this might be to actually implement given that it deals with pretty low-level stuff.
I guess I should ask if this has come up on the list before in case there's past discussion to be consulted with. Also, I'm kind of new to the world of MySQL subselects (which my first pass solution depends on) -- are they at all efficient?
Here's the general idea:
SELECT @rownum:=@rownum+1 'position', post_name
FROM wp_posts, (SELECT @rownum:=0) sub2
ORDER BY post_date DESC) sub1
WHERE post_name = 'url-slug-foo'
ORDER BY post_date DESC
More information about the wp-hackers