Fix for issue #1838

Changed `if ( $post_id === null )  {` to `if ( $post_id === null || $post_id != get_the_ID() ) {`
Resolves issue #1838