next_posts_link – displays same results
-
Ahoy friends of the WordPress realm.
I have created a large theme for a filming company and am having issues displaying previous results when I list 10 posts of a single category per page. This may have to do with the way I setup the theme.
Basically, I wanted the ‘News’ & ‘Where are We Now’ pages to be somewhat like an archives page just customized showing 10 posts in that category. Simple enough?
I made the pages based off of template pages I created that were based off the Archive.php. I am wondering if has something to do with the fact that its a template page because it seems to work fine on the normal Arhcive’d pages.
If I click the Previous Posts on these pages it loads a new page, but it has the same results. The strange part is it acts like its right, for instance, the ‘Whe Are We Now’ section will only go back once because there are only 12 entries, this not letting it go back any further, but it still has the same 10 posts on the page.
Here’s the ‘news’ section link – https://www.process-films.com/news – when you click ‘Older Entries’ at the bottom the same 10 display.
Here is the code –
<?php /* Template Name: NEWS_TMPLATE */ ?> <?php get_header(); ?> <div id="post_content_left_holder"> <?php query_posts('category_name=News'); if (have_posts()) : ?> <h3 class="title" style="width:200px;">News <img src="<?php bloginfo('template_directory'); ?>/images/process_bullet.png" align="absbottom" /></h3> <br /> <?php while (have_posts()) : the_post(); $thumb = get_post_meta($post->ID, 'large_preview', $single = true);?> <div class="archive_style"> <div id="date_holder"> <div id="date_day" align="right"><?php the_time('d'); ?></div><div id="date_suffix" align="left"><?php the_time('S'); ?></div> <div id="date_month" align="center"><?php the_time('F'); ?> <?php the_time('Y'); ?> </div> </div> <div class="pic_holder"> <div id="test"> <a href="<?php the_permalink( ); ?>"> <?php // if there's a thumbnail if($thumb !== '') { ?> <img src="<?php echo $thumb; ?>" class="large_thumb" border="0" /> <?php } // end if statement // if there's not a thumbnail else { echo ''; } ?> </a> </div> </div> <div class="archive_entry"> <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <div class="entry"> <?php the_excerpt() ?> </div> <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> </div> </div> <?php endwhile; ?> <div class="navigation"> <div class="alignleft"style="float:left;"><?php next_posts_link('« Older Entries') ?></div> <div class="alignright" style="float:right;"><?php previous_posts_link('Newer Entries »') ?></div> <br /> <br /> </div> <?php else : if ( is_category() ) { // If this is a category archive printf("<h2 class='center'>Sorry, but there aren't any posts in the %s category yet.</h2>", single_cat_title('',false)); } else if ( is_date() ) { // If this is a date archive echo("<h2>Sorry, but there aren't any posts with this date.</h2>"); } else if ( is_author() ) { // If this is a category archive $userdata = get_userdatabylogin(get_query_var('author_name')); printf("<h2 class='center'>Sorry, but there aren't any posts by %s yet.</h2>", $userdata->display_name); } else { echo("<h2 class='center'>No posts found.</h2>"); } get_search_form(); endif; ?> </div> <!-- /Div Above Closing Content --> <?php get_sidebar(); ?> <br style="clear:both;" /> <?php get_footer(); ?>
Thank you for looking and helping, i’d buy you a drink at the pub if you help me fix this. ??
- The topic ‘next_posts_link – displays same results’ is closed to new replies.