アーカイブページの作成
-2015年03月18日-
2 | if (have_posts()): while (have_posts()): the_post();?> |
4 | <div class = "post-thumb img-block" ><a href= "<?php the_permalink(); ?>" ><?php the_category_image();?> <!--設定はfunctions.phpに--></a></div> |
5 | <div class = "post-right" > |
6 | <h1 class = "post-title" ><a href= "<?php the_permalink(); ?>" ><?php the_title(); ?></a></h1> |
7 | <?php $terms01 = get_the_term_list( get_the_ID(), 'blog_cat' ); ?> |
8 | <div class = "post-date" ><?php the_date(); ?> <br /> |
9 | <span><?php echo $terms01 ; ?></span></div> |
10 | <?php echo mb_substr(get_the_excerpt(), 0, 38), "..." ; ?> |
11 | </div><!-- / .post-right --> |
12 | </div><!-- / .blogloop --> |
17 | if (function_exists( 'wp_pagenavi' )) { wp_pagenavi(); } ?> |
21 | </div><!-- / #paging --> |
●loop-blog.phpとしてまとめておくと便利です。
ループさせたい箇所に下記のように設置します。
1 | <?php get_template_part( 'loop' , 'blog' ); ?> |