Update index.php

Condensed the code into a more readable format with a couple functions and added a function to get the last update for the blog and post it.