/ Published in: PHP
Returns the page object of the parent of the current page.
Expand |
Embed | Plain Text
function get_parent_page() { global $post; $topParent = $post; while ($topParent->post_parent) { $topParent = $topParent->post_parent; } return get_page($topParent); }
You need to login to post a comment.
