Refactor post pagination on show page