Support

Account

Home Forums General Issues gettimg custom field values from parent and grandparent page? Reply To: gettimg custom field values from parent and grandparent page?

  • this way i get the title of the parent page, maybe the code helps you:

    <?php if(is_page()):
        $toppage=array_reverse(get_post_ancestors($post->ID));
        if($toppage[1]){
            echo '<h1 class="site-title">'.get_the_title($toppage[1]).'</h1>';
        }
        endif;
    ?>