You know you can just turn on a list of categories from your Admin? No custom coding required.