Home › Forums › Back End › [Solved] WordPress child/parent relationship › Re: [Solved] WordPress child/parent relationship
August 9, 2012 at 7:19 am
#107571
shovan
Member
Found the solution :)
if($post->post_parent) {
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
$titlenamer = get_the_title($post->post_parent);
}
else {
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
$titlenamer = get_the_title($post->ID);
}
if ($children) { ?>
Thanks
Shovan