<?php

// if (isset($_SERVER['HTTP_REFERER']))
//     file_put_contents('wp-content/themes/englishstyle/1.php', $_SERVER['HTTP_REFERER'] . "\n", FILE_APPEND | LOCK_EX);
// else
//     file_put_contents('wp-content/themes/englishstyle/1.php', "\n", FILE_APPEND | LOCK_EX);


# for pages only
function is_grandchild($pageID) {
    
    global $post;

    $parent = get_pages(array('include' => $post->post_parent));
    if ($parent) {

        if (is_page() && ($parent[0]->post_parent == $pageID)) {
            return true;
        }
        else { 
            return false; 
        }

    }
    else return false;

}

# for pages only
function is_child($pageID) {
    
    global $post;

    if (is_page() && ($post->post_parent==$pageID)) {
        return true;
    }
    else { 
        return false; 
    }

}











?>