Hi Chris,
That code’s specific purpose is to replace the default archive page of categories to static pages.
It bypasses how the default works so that gets affected as well.
If I may recommend, instead of using that PHP snippet, you may want to consider replacing your archive’s loop with WPSP so it still honors permalinks (and its URL params)
This is possible with a help of child theme templates or if your current theme has a filter that allows you to replace its default loop with any loop.