Fixed bug in getSidebar when query is empty
Cleaned up default theme template code