• Hi, I’m trying to get pagination working on my site found here. What I have set up is a specific category called frontpage (catID=15) that users must check in order for their posts to be shown on the home page when they post them. I want to set up pagination links at either the top, bottom or both of the home page so that users can navigate back and forth between only the articles that are in the frontpage category. I’ve read the codex on next_post_link() previous_post_link() and <?php posts_nav_link(); ?> but I’m just not savvy enough to make it work.

    I really appreciate any help you can give me.

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter whoozwah

    (@whoozwah)

    well, I was able to get the pagination working but the code that I used to fix it broke pretty much everything else. Every link to everything I have takes me back to the homepage…but the pagination works!

    eh, here’s my index code:

    <?php get_header();?>
    
    <div id="content">
    	<div class="left"><div class="lpadding">
    		<?php get_sidebar(); ?>
    	</div></div>
    
    	<div class="center"><div class="cpadding">
    
    <?php
    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("cat=15&paged=$page");
    
    ?>
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		<div class="title">
    			<h1><a href="<?php the_permalink() ?>" target="_self"><?php the_title(); ?></a></h1>
    			<h4><?php _e("Posted in: "); ?><?php the_category(',') ?><?php _e(" by "); ?><?php the_author_posts_link() ?><?php _e(" on "); ?><?php the_time('F j, Y'); ?><?php _e(" "); ?><?php edit_post_link(__('Edit')); ?></h4>
    		</div>
    
    		<?php the_content(__('(more...)')); ?>
    		<div class="clear"></div>
    
    		<div class="tags">Tags: <?php the_tags('', ', ', ''); ?></div>
    		<div class="permalink"><?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?></div>
    
    		<?php comments_template(); // Get wp-comments.php template ?>
    
    	<?php endwhile; else: ?>
    	<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    	<?php endif; ?>
    
    	</div></div>
    	<div class="clear"></div>
    </div>
    
    <?php get_footer(); ?>

    Where in or out of the loop is everything broken?

Viewing 1 replies (of 1 total)
  • The topic ‘pagination for individual posts’ is closed to new replies.