formatting and sorting data
workout previous and next posts