• Hi, can anyone please tell me how to get page->parent’s name.
    I can only get it’s id

    $page = get_queried_object();
    $pageparent = $page->post_parent;
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi nookaround,

    Yes, $page->post_parent is the page id.

    If all you want is the parent page’s title, then you can do this:

    $parent_title = get_the_title($page->post_parent);.

    Whit

    Thread Starter awesome

    (@nookaround)

    @whit, thank you, that’s exactly what i wanted

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get page->parent name?’ is closed to new replies.