Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Latests posts with bootstrap
<div class="row latestposts">
$args = array(
'posts_per_page' => 2
$postlist =get_posts($args);
foreach($postlist as $post){
setup_postdata( $post );
<div class="col-md-4">
<?php the_post_thumbnail( 'wpbs-featured' ); ?>
<div class="col-md-8">
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
<h3 class="h2"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
</header> <!-- end article header -->
<section class="post_content">
<?php the_excerpt(); ?>
</section> <!-- end article section -->
<p class="meta"><?php _e("Posted", "wpbootstrap"); ?> <time datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time(); ?></time> <?php _e("by", "wpbootstrap"); ?> <?php the_author_posts_link(); ?> <span class="amp">&</span> <?php _e("filed under", "wpbootstrap"); ?> <?php the_category(', '); ?>.</p>
</footer> <!-- end article footer -->
</article> <!-- end article -->
<?php } wp_reset_postdata(); //foreach ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.