我正在查询页面ID的子页面。如何回显显示“父标题”的父页面?使用<?php echo get_the_title( $ID ); ?>
不是选项。
<?php
$args = array(
\'post_type\' => \'page\', //write slug of post type
\'posts_per_page\' => -1,
\'post_parent\' => \'2\', //place here id of your parent page
\'order\' => \'ASC\',
\'orderby\' => \'menu_order\'
);
$childrens = new WP_Query( $args );
if ( $childrens->have_posts() ) : ?>
<div class="content">
<h2 class="big grid_3">PARENT TITLE</h2>
<div class="grid_6 right">
<?php while ( $childrens->have_posts() ) : $childrens->the_post(); ?>
<div class="grid_2 left" id="teaser" >
<p class="subtitle"></p>
<h3><?php the_title(); ?></h3>
<?php the_excerpt(); ?>
<a class="cta_light" href="<?php the_permalink(); ?>">Mehr erfahren</a>
</div>
</div>
</div>
<?php
endwhile;
endif;
wp_reset_query();
?>
谢谢!