• i have create a custom page for showing all post,,,,,, post is showing but my pagination is not working…only display 1,2,3,4,5,6 but not change when click please help me code is here

    <?php
    /*
    Template Name: preetamg
    */
    ?>
    <?php get_header(); ?>
    <div id=”single_page_outer”>
    <div id=”single_page_inner”>

    <div id=”gridContainer”>
    <?php
    $c = 1; //init counter
    $bpr = 3; //boxes per row
    query_posts(
    array(
    ‘post_type’ => ‘post’,
    ‘posts_per_page’ => 1

    )
    );

    if(have_posts()) :
    while(have_posts()) :
    the_post();
    ?>
    <div class=”post1″>

    <div id=”arti_heading”><b>“><?php the_title(); ?></b></div>
    <?php the_content(); ?>

    </div>
    <?php
    if($c == $bpr) :
    ?>
    <div class=”clr”></div>
    <?php
    $c = 0;
    endif;
    ?>
    <?php
    $c++;
    endwhile;
    if (function_exists(“pagination”))
    {
    pagination($additional_loop->max_num_pages);
    }

    endif;
    ?><?php wp_reset_query(); ?>
    <div class=”clr”></div>
    </div>

    </div>
    </div>

    <?php get_footer(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • You need to set the $paged variable and pass it to your query. Also, the call to pagination() should pass the proper query object – $additional_loop is not set anywhere. This should probably be coded like this:

    if (function_exists("pagination")) {
       global $wp_query;
       pagination($wp_query->max_num_pages);
    }

    See this Codex article for more information: http://codex.wordpress.org/Pagination#Advanced_Troubleshooting_Steps

    Thread Starter preetam

    (@preetam2012)

    thanksss vtxyzzy i am using this code ‘paged’=>$paged, and its working thankuuu
    query_posts(
    array(
    ‘paged’=>$paged,
    ‘post_type’ => ‘post’,
    ‘posts_per_page’ => 6

    )
    );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘pagination not working in page blog’ is closed to new replies.