fix post sorting, next/prev links, general bugginess with getPosts()