Fix logic for checking if a page is a post