Properly set the is_singular flag on pages, posts and attachments