su_posts template=”templates/post-list01.php” posts_per_page=”5″ order=”desc”

 

 

<div class=”post-list”>
<?php if ( $posts->have_posts() ) : ?>
<?php while ( $posts->have_posts() ) : $posts->the_post(); ?>
<div class=”onepost”>
<?php // カテゴリの情報を取得
$category = get_the_category();
//$cat_id = $category[0]->cat_ID;
$cat_name = $category[0]->cat_name;
$cat_slug = $category[0]->category_nicename;
?>
<div class=”onepost-cat <?php echo $cat_slug;?>”><?php echo $cat_name;?></div>
<div class=”onepost-meta”>
<?php the_time( get_option( ‘date_format’ ) ); ?>
</div>
<div class=”onepost-title”><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></div>
</div>
<?php endwhile; ?>
<?php else : ?>
<h4><?php _e( ‘Posts not found’, ‘shortcodes-ultimate’ ); ?></h4>
<?php endif; ?>
</div>