有不少朋友在使用wordpress博客時(shí)會(huì)碰到在分類,標(biāo)簽,分頁(yè)顯示,翻頁(yè)出現(xiàn)404錯(cuò)誤或找不到頁(yè)面的情況,這個(gè)問題我也碰到了,,下面給大家介紹一下解決方法.
在wordpresswp-includesclasses.php里面的handle_404方法 刪除&& !is_paged() 即可,代碼如下:
function handle_404() { global $wp_query; if ( !is_admin() && ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) { // Don’t 404 for these queries if they matched an object. if ( ( is_tag() || is_category() || is_tax() || is_author() ) && $wp_query->get_queried_object() && !is_paged() ) { if ( !is_404() ) status_header( 200 ); return; } $wp_query->set_404(); status_header( 404 ); nocache_headers(); } elseif ( !is_404() ) { status_header( 200 ); }}