move pagination to posts controller