some theme fixes

Also a get/print function for custom fields