title: Displaying parent page on child page list
body: <p>I have a script that is displaying child page list on parent page and a list o child pages without the current child page.</p>
  
  <p>I would like to add the parent page on child pages, but I don't know how to achieve it. Could you please help me out?</p>
  
  <p>This is my code:</p>
  
  <pre><code>if ('page-parent') {
  echo '&lt;h3&gt;See also&lt;/h3&gt;';
    // if we are on a parent page set the $parent variable to current post id
    // otherwise set $parent variable to current post parent
    $parent = $post-&gt;post_parent == 0 ? $post-&gt;ID : $post-&gt;post_parent;
  
    // if we use current post parent as $parent, exclude the current page
    $exclude = $parent == $post-&gt;post_parent ? $post-&gt;ID : false;
  
    // get all the children
    $args = array( 'parent' =&gt; $parent, 'sort_column' =&gt; 'menu_order' );
    if ( $exclude ) $args['exclude'] = $exclude;
    $child_pages = get_pages($args);
  
    // show only if there are children
    if ( ! empty($child_pages) ) {
      global $post;
      foreach ( $child_pages as $post ) { setup_postdata( $post );
      ?&gt;
      &lt;div class="child-thumb"&gt;
        &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
      &lt;/div&gt;
      &lt;?php
      }
      wp_reset_postdata();
    }
  </code></pre>
  
  <p>}</p>