WordPress Pagination Function
From http://wp-snippets.com/pagination-without-plugin/