For more WordPress theme snippets visit this old post of mine:

WordPress Cheatsheet