やり方はいろいろですが自分のやり方を。。。
<?php
$c_pages = get_pages( 'child_of=' . $post -> ID );
if ( $c_pages ) {
foreach ($c_pages as $c_page) {
$c_title = apply_filters( 'the_title', $c_page -> post_title );
$c_content = get_extended( $c_page -> post_title );
$c_content = apply_filtes( 'the_content', $c_content['main'] );
?>
<h3><?php echo $c_title; ?></h3>
<?php echo $c_content; ?>
<?php
}
}
?>apply_filtesで the_title や the_content をフックすることでコンテンツを成形してくれます。
get_extendedは <!-- more --> で区切った内容を取得してくれます。
get_extendedは <!-- more --> で区切った内容を取得してくれます。
使用している関数
0 件のコメント:
コメントを投稿