• $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    $args=array(‘post_type’ =>’gallery’,’catelog’ =>$catelog,’paged’ => $paged,’post_per_page’ => 1);
    $wp_query = new WP_Query($args);
    if ( $wp_query->have_posts() ) {
    while ($wp_query->have_posts()) {
    $wp_query->the_post();
    the_title( ‘<h1>’, ‘</h1>’ );
    the_content();
    }
    wp_pagenavi( array( ‘query’ => $wp_query ) );
    wp_reset_postdata();
    }

    This is my code but pagenavi not working,i have done this on archive-gallery but no pagination is seen in my output page that is localhost/wordpress/gallery

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jamsheer

    (@jamsheer)

    I have 4 posts there was an error in my $args i corrected it to posts_per_page=>1 now iam seeing pagination but when i click on that say next arrow its redirecting to 404 page

    Thread Starter jamsheer

    (@jamsheer)

    even next posts link not working my permalink struscture is

    /%category%/%postname%/

    going to page2 giving 404 page

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘pagenavi not working on custokm post type’ is closed to new replies.