Fix PHP warning in posts with no relations

Explained here
http://wordpress.org/support/topic/patch-undefined-variable-r?replies=1#post-3849108