query_posts() and pagination issues
-
I know this has been asked and answered many times, but simply I cant get this to work. I have tried all the solutions posted here and over Internet, but they not work in my case 🙂
I want to display some posts with specific tags with custom time line.
Right now my code looks like this:<div class="someclass"> <?php function filter_where($where = '') { $where .= " AND post_date >= '2010-01-01' AND post_date < '2010-08-01'"; return $where; } add_filter('posts_where', 'filter_where'); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('tag=tagone,tagtwo&paged=$paged');?> <?php $i=0; if (have_posts()) : while (have_posts()) : the_post(); $i++ ?> <?php $thumb = get_post_meta($post->ID, 'thumbnail', $single = true); ?> <p> <?php echo $i.'. '; the_title(); ?> </p> <?php endwhile; endif; ?> </div> <!--content-block putopis end--> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> <?php wp_reset_query(); ?>Code above work as it should. It display posts from 2010-01-01 to 2010-08-01, which have tags “tagone” and “tagtwo”
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
The topic ‘query_posts() and pagination issues’ is closed to new replies.