Add query_posts check and wp_head/wp_foot complex validations