Using this piece of code you can show content depending if it's a child-page or not:
<?php
global $post;
if ( is_page() && $post->post_parent ) : ?>
This is a child-page.
<?php else : ?>
This is a parent-page.
<?php endif; ?>
But I would like to add one more statement, so that I could have different content if it's a parent-page that has a child, or a parent-page that hasn't. Would something like this below work? If yes, what would "XXX" be?
<?php
global $post;
if ( is_page() && $post->post_parent ) : ?>
This is a child-page.
<?php elseif ( is_page() && XXX ) : ?>
This is a parent-page (with one or more children)
<?php else : ?>
This is a parent page without children.
<?php endif; ?>
Thanks in advance!