回答編集履歴
1
コードの間違いを修正(動作未確認)
answer
CHANGED
@@ -18,18 +18,16 @@
|
|
18
18
|
|
19
19
|
// コンテンツ部分
|
20
20
|
$myposts = get_posts('posts_per_page=-1&year='.$year.'&order=ASC');
|
21
|
-
|
21
|
+
$contents .= '<div class="content_area';
|
22
|
+
$contents .= ($counter==1) ? (''):(' hide');
|
23
|
+
$contents .= '">';
|
22
24
|
foreach ( $myposts as $post )
|
23
25
|
{
|
24
26
|
setup_postdata( $post );
|
25
|
-
$contents .= '<div class="content_area';
|
26
|
-
$contents .= ($counter==1) ? (''):(' hide');
|
27
|
-
$contents .= '">';
|
28
27
|
$contents .= get_the_content(); // ここで投稿ごとに必要な値を取得・格納
|
29
|
-
$contents .= '</div>';
|
30
28
|
}
|
31
29
|
wp_reset_postdata();
|
32
|
-
|
30
|
+
$contents .= '</div>';
|
33
31
|
$counter++;
|
34
32
|
}
|
35
33
|
|