SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru rashidr's Avatar
    Join Date
    Jun 2004
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Wordpress Pagination not working....

    Why my wordpress pagination is not working, here is my code.

    PHP Code:

    <?PHP header(); 

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts'cat=3&paged='.$paged); 

        <?
    php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
        <h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
        <?php endwhile; ?>
            
            <?php if(function_exists('wp_pagenavi')) { ?>     
            <div id="page-navigator">
            <?php wp_pagenavi(); ?>
            </div>     
            <?php } else { // Otherwise, use traditional Navigation ?>     
            <div class="navigation">     
                <div class="floatleft">
                <?php next_posts_link('&laquo; Next'?>
                </div>     
                <div class="floatright">
                <?php previous_posts_link('Previous &raquo;'?>
                </div>     
            </div>     
            <?php ?>
        <?php endif; ?>

    Output is fine, I can see the pages numbers but When I click on page not 2 or 3 it redirects me to the same page.

    I removed WPagenavi code and just use wordpress pagination code but result is same, it redirects me to the same page with same results...

    Where I am wrong please help me, It's urgent....

  2. #2
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pagination using WP_Query

    Here's a step by step guide to using pagination.

    http://www.stomptheweb.co.uk/2012/01...ith-wordpress/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •