Updated index.php

Rearranged post metadata and pagination. Added pagination function.