Query Post Results on Multiple Pages
-
I am new to PHP and WordPress. I have written a simple query post code that is supposed to show all posts tagged with “video” in a page. The query seems to work. The problem is that the “Next Page” & “Previous Page” functionality does not work. Although I have 12 videos on my site, the default setting for my blog is to show 10 posts per page. Therefore, this query shows just the first 10 videos. However, when I click “Next Page”, it still shows the same first 10 videos — it should show the last 2 videos when I click “Next Page”. How do I fix this? My short code is below — this is the complete content of the video.php template I am working on. Thank You!
<?php
/*
Template Name: videosget_header();
*///The Query
query_posts(‘tag=video’);//The Loop
if ( have_posts() ) : while ( have_posts() ) : the_post();
?><h3>“>
<?php the_title();?>
</h3><?php
endwhile;
endif;
?><div class=”navigation” id=”pagenavi”>
<div class=”alignleft” style=”font-size:x-large;font-weight:bold”><?php previous_posts_link(__(‘Previous Page «’,’arclite’)) ?></div>
<div class=”alignright” style=”font-size:x-large;font-weight:bold”><?php next_posts_link(__(‘» Next Page’,’arclite’)) ?></div>
<div class=”clear”></div>
</div>
The topic ‘Query Post Results on Multiple Pages’ is closed to new replies.