I’m using this script to call a link to the parent page inside one of it’s children pages:
<?php
$this_page = get_post($id);
$parent_id = $this_page->post_parent;
if ($parent_id) {
$parent = get_page($parent_id);
echo '<a href="'.get_permalink($parent->ID).'" title="">Return to '.get_the_title($parent->ID).'</a>';}
?>
This sample works just fine here:
http://www.energytoolsint.com/clean-sweep/parent-test-call/
But won’t parse here?
http://www.energytoolsint.com/healthcare-practitioners/
Same page template, one renders, the other doesn’t.
Judging by the URL, that’s because energytoolsint.com/healthcare-practitioners is a parent page. Granted, you could have changed the permalink, but the URL suggests it doesn’t have a parent, hence the null value.
Go to the page in dashboard. Look on the far right under the publish date.