Issue
For example I have term 'child', how to check do this term is child of term 'Mother' ?
id='dv4'>
Solution
As per your comments I think you can do this in the below mentioned manner -
Place this method in your theme functions.php
file
function is_child($pageID) {
global $post;
if( is_page() && ($post->post_parent==$pageID) ) {
return true;
} else {
return false;
}
}
Then you can use this method anywhere in your theme --
<?php
if(is_child(343)) {
echo "This is a child page of 'The Parent Page Title'.";
}
?>
Reference - http://bavotasan.com/2009/check-if-a-page-is-a-child-of-another-page-in-wordpress/
Answered By - swapnesh Answer Checked By - Timothy Miller (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.