据我所知,您需要通过该查询显示这些页面的内容。因此,您可以像下面这样修改代码-
<?php
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php
$args = array(
\'post_type\' => \'page\',
\'post__in\' => array( 2770, 10, 266, 1558 ) //list of page_ids
);
$page_query = new WP_Query( $args );
if( $page_query->have_posts() ) : ?>
<div class="pages-on-page">
<?php
//print any general title or any header here//
while( $page_query->have_posts() ) : $page_query->the_post(); ?>
<div>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div>
</div>
<?php
endwhile;
echo \'</div>\';
else:
endif;
wp_reset_postdata();
?>
</div><!-- #content -->
</div><!-- #primary -->
希望这有帮助。