0
我需要顯示父頁面的所有孩子和孫子,但我想要自定義輸出而不是wp_list_pages()給出的標準輸出。WP_LIST_PAGES使用WP_QUERY定製輸出
<?php
wp_list_pages(array(
'title_li' => '',
'child_of' => $post->ID
));
?>
我設法顯示到兒童網頁,但使用這種沒有孫子:
<?php
$args = array(
'post_type' => 'page',
'post_parent' => $post->ID,
'order' => 'ASC'
);
$the_query = new WP_Query($args);
?>
<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>" rel="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="table">
<div class="table-cell">
<span></span>
<h3><?php the_title(); ?></h3>
</div>
</div>
</a>
</li>
<?php endwhile; ?>
<?php endif; ?>
關於如何擴展該代碼顯示在子頁面就像當初wp_list_pages孫子任何建議() ?
謝謝!