• Hey everyone,

    I want to display the parent title above the title of the current page. I tried this:

    <h3><?php echo '<a href="'.get_permalink($post->post_parent).'">'.get_the_title($post->post_parent).'</a>'; ?></h3>
    <h2 class="post-title"><?php the_title(); ?></h2>

    But it gives me only the title of the current page, twice.
    The page is definetly a child of another page. Any idea what I’m doing wrong here?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Get title from parent page’ is closed to new replies.