I have a hierarchical custom post type, and on each single view of a post of this type I want to display the title of the children of this post, outside of the loop.
The code I'm currently using is below, and it works - but I've no idea whether it's a sensible way to do it or if there's other options.
$pageChildren = get_pages('child_of='.$post->ID."&echo=0&post_type=show");
if ( $pageChildren ) {
foreach ( $pageChildren as $pageChild ) {
echo '<p><a href="' . get_permalink($pageChild->ID) . '">'. $pageChild->post_title.'</a></p>';
}
}
wp_list_pages()
!