首页 > CMS > Wordpress > 正文

Wordpress分类_标签 分页显示 翻页出现404错误

2024-09-07 00:50:06
字体:大 中 小
来源:转载
供稿:网友

有不少朋友在使用wordpress博客时会碰到在分类,标签,分页显示,翻页出现404错误或找不到页面的情况,这个问题我也碰到了下面给大家介绍解决方法.

在wordpresswp-includesclasses.php里面的handle_404方法 删除&& !is_paged() 即可,代码如下:

  1. function handle_404() { 
  2. global $wp_query; 
  3. if ( !is_admin() && ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) { 
  4. // Don’t 404 for these queries if they matched an object. 
  5. if ( ( is_tag() || is_category() || is_tax() || is_author() ) && $wp_query->get_queried_object() && !is_paged() ) { 
  6. if ( !is_404() ) 
  7. status_header( 200 ); 
  8. return; 
  9. } 
  10. $wp_query->set_404(); 
  11. status_header( 404 ); 
  12. nocache_headers(); 
  13. } elseif ( !is_404() ) { 
  14. status_header( 200 ); 
  15. } 
  16. } 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表