<ul id="post-list">
            <?php

            $IDOutsideLoop = $post->ID;
            global $post;

            $args = array( 'numberposts' => 7 );
            $myposts = get_posts( $args );
            foreach( $myposts as $post ) :  setup_postdata($post); ?>
                <li <?php if ($IDOutsideLoop == $post->ID) { echo " class=\"current\""; }?>>
                    <a href="<?php the_permalink(); ?>"><?php the_title(); ?><br /><span><?php the_author(); ?></span></a>
                </li>

            <?php endforeach; ?>

            <?php my_paginate_links(); ?>

            </ul>

The pagination shows up but it shows too many pages (there aren't even that many posts) and when I click on 'next', the url in the address bar shows /page/2 but nothing changes and the page doesn't actually go to page 2, if that makes sense. I think something needs to be added to the code above but I am not sure what. Does anybody have the slightest clue?

link|improve this question
feedback

1 Answer

$args that you use in get_posts() are always same so you get same posts so how would pagination work?

You need to adjust posts retrieves, see WP_Query in Codex, especially parts about paged query argument.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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