Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 649

Wordpress: WORKING custom post list page with pagination throws a 404 TITLE in header

$
0
0

Let me start off by saying that it's NOT a 404 error issue.

I have a custom PHP post list page (basically an archive page) that pulls contents correctly, with working numbered pagination, but when I go to page 2, it shows everything correctly again but the title says '404: Page Not Found'. Debugging shows that is_404() is returning true from \wp-includes\query.php

It's weird because I fixed the rewrite rule to make it work and not throw a 404 error, but I can't fix the title of the page.

$paged = (get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;$args = array('posts_per_page' => '1','paged' => $paged,'post_type' => 'post','post_status' => 'publish','tax_query' => array(        array('taxonomy' => 'category','field'    => 'term_id','terms'    => $catID,           ),        ),'orderby' => array('title'=>'ASC'),     );$post_raw = new WP_Query($args);//building page with queried data$total_pages = $post_raw->max_num_pages;if($total_pages>1){     $current_page = max(1, get_query_var('paged'));     $page = paginate_links(array('base' => get_pagenum_link(1) . '%_%','format' => 'page/%#%/','current' => $current_page,'total' => $total_pages,'prev_text'    => __('«'),'next_text'    => __('»'),'type' => 'list','add_args'  => array(),      ));      echo $page;}

Viewing all articles
Browse latest Browse all 649

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>