• Resolved jbeltran

    (@jbeltran)


    Hi,

    I’m kind of stuck finding a way to display the parent page permalink. What I’m trying to accomplish is a simple navigation list

    e.g. when on the About page, the sidebar will show:
    About
    – About Subpage 1
    – About Subpage 2
    – About Subpage 3

    I’m using the wp_list_pages to list the child pages. I’m kind of stuck as to how show the parent link. If anyone can help, it would be really appreciated!

Viewing 1 replies (of 1 total)
  • Thread Starter jbeltran

    (@jbeltran)

    After some tinkering, I finally figured it out. For anyone who has the same issue, here’s the code to display the parent page:

    $parentLink = get_permalink($post->post_parent);
    $parentTitle = get_the_title($post->post_parent);
    
    <a href="<?php echo $parentLink; ?>"><?php echo $parentTitle; ?></a>
Viewing 1 replies (of 1 total)
  • The topic ‘Displaying the parent page permalink’ is closed to new replies.