Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Latests posts with bootstrap
<div class="row latestposts">
<?php
$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>
<div class="col-md-8">
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
<header>
<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 -->
<footer>
<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 -->
</div>
<?php } wp_reset_postdata(); //foreach ?>
</div>
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.