有不少朋友在使用wordpress博客時會碰到在分類,標簽,分頁顯示,翻頁出現404錯誤或找不到頁面的情況,這個問題我也碰到了下面給大家介紹解決方法.
在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 );
- }
- }
新聞熱點
疑難解答
圖片精選