Random Redirect With Pretty URLs And WordPress 2.5
I didn’t realise that upgrading WordPress would break the pretty random redirect plugin that I modified, but it was brought to my attention today that it did. So, I set about trying to fix it.
The solution I came up with was to create a page with the permalink “/random/”, so that I could apply a page template to it.
Grab my page template: Source, ZIP. Upload it to your active theme directory.
Now you need to create a page called Random. You can fill it with any text you want, because no-one will see it anyway.
At the bottom of the WordPress edit page panel, under Advanced Options, select the random redirect page template.
You now have a fully functional /random/ page that will redirect you to a random post on your site when someone visits it, and the page will show up on any page lists you have on your theme, meaning you don’t have to manually add the link.
Now wasn’t that easy?



Reader Comments
One response so far
1Hairgel_Addict August 1st, 2008 at 8:00 pm
Leave a commentthnx a lot! works great!