## If Child or Grandchild of Page

Question

I’m serving a different header in WordPress depending what section you are within the site, ‘residential’ , ‘business’ or other by using the following code. Although i need to extend it to work with grandchildren as well, so another level down.

<?php
/*
Template Name: Package
*/
if (is_page('business') || $post->post_parent=="17") { get_header('business'); } else if (is_page('residential') ||$post->post_parent=="19")
{