Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAshish Mehra
523 PointsPagination in wordpress
how to setup pagination here I set front-page displays as a latest posts.
<div class="row child-section">
<?php
/**************************************
* Generating multiple posts
*************************************/
$args = array(
'type' => 'post',
'posts_per_page' => 6,
'offset' => 1
);
$query = new WP_Query($args);
if($query->have_posts()):
while($query->have_posts()):
$query->the_post();
?>
<div class="col-xs-6 col-sm-3 other-post clearfix">
<div class="featured-img">
<?php the_post_thumbnail(); ?>
</div>
<h1 class="post-heading">
<?php
$title = wp_trim_words(get_the_title(),3," .. ");
echo $title;
?>
</h1>
<p class="small-desc">
<?php echo get_the_excerpt(); ?>
<p>
<a href="<?php the_permalink(); ?>" class="read-btn">READ MORE</a>
</div>
<?php
endwhile; wp_reset_postdata(); endif;
?>
</div>