【问题标题】:wordpress paging bugs?wordpress 分页错误?
【发布时间】:2013-12-08 00:35:51
【问题描述】:

我正在使用 wordpress 最新版本。

目前我的博客设置为自定义永久链接/index.php/%postname%/

http://abc.com/blog/index.php(工作正常)

但是当点击 NEXT 按钮转到第 2 页时,它失败了。

假设去http://abc.com/blog/index.php/page/2/

但它转到http://abc.com/blog/index.php/Index.php/page/2/

(正在添加额外的 /Index.php/....)

这种情况只发生在第 2 页。 在第 2 页转到第 3 页之后,该 url 工作正常。

【问题讨论】:

    标签: wordpress paging


    【解决方案1】:

    很容易修复。

    只需在 wp-includes/formatting.php 中的 clean_url() 函数:

    $url = str_replace('index.php/Index.php','index.php',$url);
    

    只需在函数开头的任何“if 语句”之前给出这一行

    【讨论】:

      【解决方案2】:

      我认为不需要使用 index.php 来查看登录页面。

      http://abc.com/blog/
      

      上面的网址足以看到着陆页

      http://abc.com/blog/index.php
      

      当我访问上面的网址时。我刚刚看到了

      sorry, we couldn't find that page
      
      Please try using the search above or follow one of the links below.
      

      因此重写规则将 index.php 视为页面。

      然后我在 url 登陆页面中看不到任何分页。

      谢谢

      【讨论】:

        猜你喜欢
        • 2015-07-18
        • 2013-05-30
        • 1970-01-01
        • 1970-01-01
        • 2012-07-10
        • 1970-01-01
        • 2017-09-22
        • 2013-01-11
        • 2014-01-05
        相关资源
        最近更新 更多