cleaned up code for index,page and single.php by moving function calls to header.php