because of some duplication and as i am not getting my desired result i have removed my previous questions i have asked about pagination issue , i am posting again so i might get any help .

if ( get_query_var( 'paged' ) ) { $paged = get_query_var( 'paged' ); }
elseif ( get_query_var( 'page' ) ) { $paged = get_query_var( 'page' ); }
else { $paged = 1; }
$wp_mainblog_query = new WP_Query('posts_per_page=3&paged=' . $paged );
if($wp_mainblog_query->have_posts()) :
    while($wp_mainblog_query->have_posts()) :
        $mainblog_img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID));

    echo paginate_links(array(
      'total' => $wp_mainblog_query->max_num_pages


i am not adding html in the question but you will understand the loop and everything else , now the thing is i dont know what is the issue everything seems fine in the code but the issue i am seeing is when i click on page number 2 it will go to the link to number 2 but it is not being active in the pagination , pagination will show 1 number activated and other thing is the next button/link will always go to page/2 (The page at which i am applying this pagination is index.php) not a blog page not home.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.