added in more checks including the case where post_parent is zero (front page)