Update related posts function.