sou
7/30/2017 - 2:05 AM

トップページに最新記事5件を日付・タイトルをリスト表示。 過去記事の日数は($days=30;)を変更

トップページに最新記事5件を日付・タイトルをリスト表示。 過去記事の日数は($days=30;)を変更

<div class="columnBox__3col">
  <?php query_posts('posts_per_page=6'); ?>
  <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="columnBox__3colList">
<!--img取得-->

<!--img取得end-->
<h2 class="columnBox__innerboxTitle"><a href="<?php the_permalink(); ?>"><?php the_title();?></a>
<span class="columnBox__innerboxTitle--date">
<?php the_time('Y.n.j'); ?>
  <?php
    $days=30;
    $today=date('U'); $entry=get_the_time('U');
    $diff1=date('U',($today - $entry))/86400;?></span>
    </h2>
    <!--/.columnBox__3colList_list--></div>
  <?php endwhile; endif; ?>
  <?php wp_reset_query(); ?>
<!--/.columnBox__inerbox--></div>