Fixing WP links on the front page
I’m on a long vendetta to get Nomadig URLs more search engine friendly — the aim is to replace all URL parameters with a path that has the same information.
When I launched the site, I was too lazy to make a proper link structure for the journal section. That was fixed when I installed WP 1.5 and got the rewrite rules in order.
After I finished the new URL schema for reviews a week ago, the front page requested my attention. I had changed the front page links to reviews, but for some reason most of the links to journal were in form of /journal/index.php?p=….
I was using the guid field from the WordPress database. For most of the posts, it contains a proper URL with year, month, data and the post name with dashes. But for other posts, it had still index.php?p=…
To cut the long story short, I had to add a new function to the front page PHP code to create proper links to the articles, and use that function every single time the front page has a link to journal. Now the links are brilliantly search engine friendly.
1. — Aug 30 2008