fix prev, next posts functions...add to template