Translated from our Japanese archive. Dates, product names and examples reflect the original article; this is not an updated product or service recommendation.
Displaying posts
This example uses a category slug together with Bootstrap to display four posts. It is a pattern I use often.
<?php query_posts(‘category_name=news&posts_per_page=4′); ?>
<?php if(have_posts()): ?>
<?php while(have_posts()): the_post(); ?>
<div class=”ttl_underline mb10 pb10 clearfix”>
<div class=”col-md-4″><?php the_post_thumbnail(‘thumbnail’); ?></div><div class=”col-md-8″><h4 class=”font20″><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></h4><br /><p><?php echo mb_substr(strip_tags($post-> post_content),0,80); ?></p></div>
</div>
<?php endwhile; ?>
<?php endif; wp_reset_query(); ?>