Skip to content

Instantly share code, notes, and snippets.

@sunilw
Created September 7, 2015 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunilw/669906f4207445b4a2a4 to your computer and use it in GitHub Desktop.
Save sunilw/669906f4207445b4a2a4 to your computer and use it in GitHub Desktop.
<?php
$args = array(
'posts_per_page' => 9
) ;
$my_query = new WP_Query($args) ;?>
<section id="" class="container-fluid">
<?php $count = 0 ?>
<?php if ($my_query->have_posts()) : ?>
<div class="row">
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<article class="post col col-xs-12 col-sm-4">
<h3> <a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3>
<p><?php the_excerpt(); ?></p>
<?php $count++ ?>
<p><a href="<?php echo get_permalink() ?>">read more</a></p>
</article>
<?php if ( $count %3 == 0 ) { ?>
</div>
<div class="row">
<?php } ?>
<?php endwhile; ?>
<?php endif; ?>
</section> <!-- ENDS .container -->
<footer class="pagination container-fluid">
<?php echo the_posts_pagination(); ?>
</footer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment