Hello, I've read that it is possible to retrieve the link to the parent page with
echo '<a href="'.get_permalink($post->post_parent).'">'.get_the_title($post->post_parent).'</a>';
But is it possible to retrive the parent page ID or slug ?
Thanks !
Hello, I've read that it is possible to retrieve the link to the parent page with
echo '<a href="'.get_permalink($post->post_parent).'">'.get_the_title($post->post_parent).'</a>';
But is it possible to retrive the parent page ID or slug ?
Thanks !
Sure. You already know how: $post->post_parent is the parent's ID number.
Here is the parent page ID
$post->post_parent
Here is the Parent page Title
$post_id_7 = get_post($parentpageid);
$parentpagetitle = $post_id_7->post_title;
Here is the parent page link
get_permalink($parentpageid)
This topic has been closed to new replies.