zoukankan      html  css  js  c++  java
  • Sitemap Error : XML declaration allowed only at the start of the document解决方法

      今天ytkah的客户反馈说他的xml网站地图有问题,提示Sitemap Error : XML declaration allowed only at the start of the document,这个很大的可能是wp-config.php或主题function.php文件中有多余的空格/空行,打开他的function.php看了一下,发现在最后加了一些定义

    <?php
    remove_action('wp_head', 'rsd_link');
    remove_action('wp_head', 'wlwmanifest_link');
    ?>
    

      这个是另起了一个<?php ?>,试着把它去掉,然后把remove定义放到前面的封装里,保存上传覆盖,更新缓存,更新cdn,再访问一下xml网站地图不会出现前面的错误提示了。

      参考资料However, the cause most often is an empty line at the beginning (before the <?php line) or end of the wp-config.php or functions.php file. If there is no empty line in these files, we highly recommend running a conflict check to identify what outputs the empty whitespace. You may also need to clear your caching from your plugins/theme/CDN such as Cloudflare/server caching etc.

  • 相关阅读:
    字符串的输入输出 附带一道练习题
    NOIP2009 1.多项式输出
    算法--欧几里得
    小程序:2048
    虚函数和多态
    c++学习记录(十五)
    面向对象程序设计寒假作业3
    c++学习记录(十四)
    c++学习记录(十三)
    c++学习记录(十二)
  • 原文地址:https://www.cnblogs.com/ytkah/p/11647056.html
Copyright © 2011-2022 走看看