File: /var/www/html/wp-content/themes/ganryujima_new_1602/articles/blomaga.php
<?php $paged = get_query_var('paged'); query_posts('post_type=grjm_budo&posts_per_page=20&paged='.$paged); ?>
<?php if (have_posts()): ?>
<div class="l-lists">
<?php while (have_posts()): the_post(); ?>
<?php
$img = get_field('news_list_thumbnail');
$imgurl = wp_get_attachment_image_src($img, '3-2');
$lead = get_field('lead_text');
?>
<article class="table_article m_article_news" alt="<?php the_permalink(); ?>">
<a href="<?php the_permalink() ?>">
<div class="cover-outer">
<div class="cover m-outer-cover">
<?php if($imgurl){ ?>
<img class="image" src="<?php echo $imgurl[0]; ?>" alt="">
<?php } else { ?>
<img src="<?= home_url() ?>/assets/images/dummy3-2.jpg" alt="SAMURAI WARRIOR">
<?php } ?>
</div>
</div>
<div class="cnt">
<aside class="info">
<time><?php the_time('Y/m/d') ?></time>
</aside>
<h1>
<?php if(mb_strlen($post->post_title)>40) {
$title= mb_substr($post->post_title,0,40);
echo $title.'...';
} else {
the_title();
}?>
</h1>
<p>
<?php if(mb_strlen($lead)>40) {
$lead_txt= mb_substr($lead,0,40);
echo $lead_txt.'...';
} else {
echo $lead;
}?>
</p>
</div>
</a>
</article>
<?php endwhile; ?>
</div>
<div class="pagination"><?php wp_pagination(); ?></div>
<?php endif; ?>
<?php wp_reset_query(); ?>