Saturday Night PHP Hacking

Saturday Night PHP Hacking

After using mod_rewrite to set up categories, I needed a visual way to distinguish them. Well, maybe I didn’t need it, but I wanted it!

I split the top banner into two and made three sections that, using a bit of PHP, selects the correct navigation elements based on a new variable called $davecat. I adjusted the mod_rewrite rules in ht-access to append this variable when a url like `davidseah.com/work’ is reached.

I modified wp-rss2.php to output $category_name as part of the blog title if a category feed was specified. So now when you choose an RSS feed for one of the three main categories, it will append the the category name so you know what you’re getting.

Finally, I added paging by enabling the “posts paged” feature under Options->Reading, and adding the missing <?php posts_nav_link(); ?> just after The WordPress Loop.

It even seems to work with Staticize, which is nice. While I was at it, I moved the wordpress files into their own directory to clean up my webroot. My sis discovered it wasn’t working for her though, so I had to manually delete the staticizecache directory, and that did the trick.

I feel good.