Add related posts function