wordpress 404 after click on pagination links -
i have problem pagination in wordpress. i'm having category-template wich involkes query custom posts. problem when add pagination , go next page pagination add $_get['paged'] template reject , trow 404 page. discovered if $_get['paged']=1 works fine if 2 or more throw 404 page. thing try in index loop , not work. i'm using html5blank theme.
here code query:
<section id="inner-pad"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( //'posts_per_page' => 6, 'post_type' => 'menu-pub', 'cat' =>3, 'paged' => $paged, 'order'=>'desc' ); $wp_query = new wp_query( $args ); $i=1; while ( $wp_query->have_posts() ) { $wp_query->the_post(); ?> <article class="article-first-vision <?= ($i==2)?'mar':'' ?>" > <?php if ( has_post_thumbnail()) { ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail('menu-pub'); ?> </a> <?php }; ?> <h2> <?php the_title(); ?> </h2> <p> <?php the_content(); ?> </p> </article> <?php if($i==3){$i=0;}enter code here $i++; } ?> </section> <?php $big = 999999999; echo paginate_links(array( 'base' => str_replace($big, '%#%', get_pagenum_link($big)), 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query->max_num_pages )); ?>
here new dialog put theme this:
try add global $wp_query
before paginate_links()
Comments
Post a Comment