Home › Forums › Back End › [Solved] WordPress child/parent relationship › Re: [Solved] WordPress child/parent relationship
August 9, 2012 at 7:18 am
#107570
shovan
Member
How do you get parent page url? This is what I have
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) { ?>