Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am having issues understanding the worlds most simplest concept when it comes to building a single.php file and using pagination.

The code bellow shows a wordpress loop, its contents and then finally the pagination. How ever, the pagination does not show up for me and looking at twenty 10 theme shows this is how you are suppose to do it....So what's going on? This isn't a custom loop.

<div class="span6">
<?php 
global $post;
$thumb_nail_args = array(
    'align' => 'centered', 
    'class' => 'thumbnail marginBottom20 marginTop20'
);

if(have_posts()){
    while(have_posts()): the_post();
    ?>
    <h1><?php the_title() ?></h1>
    <p>
        <em><strong>Written by: </strong>
            <a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>">
                <?php the_author_meta('display_name'); ?></a>
        </em>
    </p>
    <p><?php 
    the_post_thumbnail('full', $thumb_nail_args);
    the_content(); 
    ?></p>
    <?php 
    endwhile;

    ?>
    <ul class="pager paddingBottom20">
      <li class="previous">
        <?php next_posts_link(); ?>
      </li>
      <li class="next">
        <?php previous_posts_link(); ?>
      </li>
    </ul><?php 
}

if('open' == $post->comment_status){
    comments_template();
}

?>
</div>
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You need next_post_link and previous_post_link, not next_posts_link and previous_posts_link. See the plural on the last two? The ones with the 's' are for archive pagination. The ones without it are for single post to post pagination.

share|improve this answer
    
I figured it was something stupid like spelling –  Kyle Adams Jan 13 '13 at 18:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.