サイトをみて下記に修正いたしましたが、
どうしても一つ残ってしまいます。。。
<?php /* ↓ Archives */ ?>
<?php
$chihirdren=get_categories( 'parent=5&hide_empty=0&orderby=slug&order=DESC');
foreach($chihirdren as $child){
?>
<?php if(have_posts()):?>
<h2 class="yearArchives"><?php echo $child->cat_name ?></h2>
<?php else: // no post ?>
<?php endif; ?>
<?php $wp_query->query(array('cat'=>$child->cat_ID,'posts_per_page'=>-1));
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<p class="yearArchivesContent">" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></p>
<?php endwhile; } ?>
大変申し訳ございません。。。
ご教授をお願いいたします。。。
大変申し訳ございません。。。
表示がおかしかったので修正いたしました。
<?php /* ↓ Archives */ ?>
<?php
$chihirdren=get_categories( 'parent=5&hide_empty=0&orderby=slug&order=DESC');
foreach($chihirdren as $child){
?>
<?php if(have_posts()):?>
<h2 class="yearArchives"><?php echo $child->cat_name ?></h2>
<?php else: // no post ?>
<?php endif; ?>
<?php $wp_query->query(array('cat'=>$child->cat_ID,'posts_per_page'=>-1));
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<p class="yearArchivesContent"><?php the_title(); ?></p>
<?php endwhile; } ?>
</cpde>
上記を正とさせてください。
よろしくお願いいたします。
教えてgooにも投稿しており問題が解決いたしましたので、
共有いたします。
<?php
$children=get_categories('parent=5&hide_empty=1&orderby=slug&order=DESC');
foreach($children as $child){
?>
<h2><?php echo esc_html($child->cat_name); ?></h2>
<?php
$my_posts = get_posts(array('cat'=>$child->cat_ID,'numberposts'=>-1));
foreach ($my_posts as $post) {
setup_postdata($post);
?>
<h3><?php the_title(); ?></h3>
<?php
}
}
wp_reset_postdata();
?>
ありがとうございました!