最好的方法是使用WP\\u查询。我认为您的错误或插件错误可能是没有定义孩子的“post\\u类型”。
WP查询:https://codex.wordpress.org/Class_Reference/WP_Query
global $post;
$args = array(
\'post_parent\' => $post->ID,
\'posts_per_page\' => -1,
\'post_type\' => \'products\', //you can use also \'any\'
);
$the_query = new WP_Query( $args );
// The Loop
if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post();
// Do Stuff
the_title();
echo "<br>";
the_content();
endwhile;
endif;
// Reset Post Data
wp_reset_postdata();