Fixed links on theme pages and listing regexp

The query for theme pages was broken, so it wasn’t showing header and
footer links. Also, the listing regexp was too broad, so the admin
links appeared on pages where they shouldn’t.