Pagination in Templates & Feeds

<ul> 
<?php 
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; 
$args = array( 
'posts_per_page' => 6, 
'post_type' =>'home_page_widget', 
'widget_type' =>'video', 
'orderby' =>'date', 
'order' =>'DESC', 
'paged' => $paged // must add paged parameter or paging will not function 
); 
query_posts($args); 
if (have_posts()) : while( have_posts() ) : the_post(); ?> 

<li> 

<a href="javascript:void(0)" class="video_link"> 
<div class="video_overlay"></div> 
</a> 

<div class="video_thumb"> 
<h3 class="video_thumb_title"><?php the_title(); ?></h3> 
<?php the_content(); ?> 
</div> 
</li> 
<?php endwhile; ?> 
<?php next_posts_link(); ?> 
<?php previous_posts_link(); ?>
<?php endif;
// Make sure the default query stays intact 
wp_reset_query(); ?> 
</ul>

 

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.