single.phpテンプレート
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<article class="single-content"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php $cats = get_the_category(); ?> <h1 class="single-heading"><?php the_title(); ?></h1> <div class="single-info"> <time class="single-info__time"></time> </div> <div class="post-archive__item__info"> <div class="post-archive__item__info"> <time class="post-archive__item__info__time"><?php the_time('Y.m.d'); ?></time> <?php foreach($cats as $cat): ?> <span class="post-archive__item__info__category"><a href="<?php echo get_category_link($cat->cat_ID); ?>"><?php echo $cat->cat_name; ?></a></span> <?php endforeach; ?> </div> <?php the_post_thumbnail('my_thumbnail_large'); ?> <div class="single-content"> <?php the_content(); ?> </div> <?php endwhile; ?> <?php else : ?> <?php endif; ?> </article> |