Exclude current post when listing related posts
-
I’m using this widget to display posts from related categories, but I want to exclude the current post from the widget . Is there a way to do this? I tried editing the source code but don’t think I have it correct:
‘post__not_in’ => $post->ID’
I keep getting a fatal error. Does anyone know what the code would be?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Exclude current post when listing related posts’ is closed to new replies.