WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Pagination with multiple columns / custom loops

[Resolved] Pagination with multiple columns / custom loops

  • For a blog I’m working on, I’ve created two columns. Each column loops posts from a certain category. It’s not clear to me how to get the pagination to work correctly.

    …I’m not quite sure where to put the pagination code:

    <?php stumblr_pagination(); ?>
    <?php echo paginate_links( $args ) ?>

    I have a container DIV, and then one DIV for each column. If I place the code in the container but outside of the columns…then my pagination links do not display. If I place the code just after the loop completes in one of the columns…then the links display. However they still do not work, clicking the links only returns the same sets of posts.

    The site is at http://www.shasnap.com

    I found this link Paging and Custom WordPress Loops, but I probably was not implementing it correctly. I’m really only putzing through this relying on a heck of a lot of google searching.

    So where should the pagination code go? And second, can anyone assist me in getting it to work? Thanks for your time in advance.

Viewing 1 replies (of 1 total)
  • Solved; Codex link

    and WP_Navi support link that helped gave me the fix:
    http://scribu.net/wordpress/wp-pagenavi/right-way-to-use-query_posts.html

    Most of the time, your theme is just using query_posts() wrong.

    So here is the correct way to make paging work using query_posts():

    Say you have something like this:

    query_posts(‘cat=8’);
    or like this:

    query_posts( array( ‘cat’ => 8 ) );
    If the file in question is a custom page template, replace it with this:

    query_posts( array( ‘cat’ => 8, ‘paged’ => get_query_var(‘page’) ) );
    Otherwise, replace it with this:

    query_posts( array( ‘cat’ => 8, ‘paged’ => get_query_var(‘paged’) ) );

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Pagination with multiple columns / custom loops’ is closed to new replies.