Previous/Next buttons not working
-
Hello, my site has pages that display posts only from a certain category. My problem is when you click “previous entries” it goes to page 2 but still displays the same posts as before. Can anyone help?
<?php /* Template Name: Blog */ ?> <?php get_header(); ?> <h1>Blog</h1> <div class="content"> <?php query_posts('category_name=Blog'); global $more; $more = 0; ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1> <?php if (get_post_meta($post->ID, 'post_image_value', true) ) { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, "post_image_value", $single = true); ?>" alt="<?php the_title(); ?>" class="portfolioimg" /></a> <?php } ?> <div class="entry"> <?php the_content('Continue Reading →'); ?> </div> <p class="meta">Written on <?php the_time('F jS, Y') ?>. <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></p> </div> <?php endwhile; ?> <div class="navigation"> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <div class="alignleft"><?php next_posts_link('← Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries →') ?></div> <?php } ?> </div> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Previous/Next buttons not working’ is closed to new replies.