Added check for post visibility to fix #819.

#819