Fatal Error while trying to get parent page permalink
-
Hi, I has been trying to display a parent page permalink on child page in two ways and I’m unsuccessful in both:
1) <?php
$parent_link = get_permalink($page->page_parent);
echo $parent_link;
?>in this way it displays the page itself link but not the parent page;
2) ?<php
$parent = get_page($page->page_parent);
echo $parent;
?>
in this way I get:
Catchable fatal error: Object of class stdClass could not be converted to string.I can’t understand why I do not get parent page (not post) link. Help pls.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Fatal Error while trying to get parent page permalink’ is closed to new replies.