admin管理员组文章数量:1333451
I have a frustrating problem. In the page source, the first line is blank, which causes issues in some browsers.
These are the steps I've taken to try to fix the problem:
- Gone back to twentythirteen theme
- renamed plugins folder to oldplugins. Checked in admin and they are all deactivated
- Made sure there is nothing outside of the php in index.php, header.php
- cleared out htdoc htaccess
I'm at a loss!
I have a frustrating problem. In the page source, the first line is blank, which causes issues in some browsers.
These are the steps I've taken to try to fix the problem:
- Gone back to twentythirteen theme
- renamed plugins folder to oldplugins. Checked in admin and they are all deactivated
- Made sure there is nothing outside of the php in index.php, header.php
- cleared out htdoc htaccess
I'm at a loss!
Share Improve this question edited Feb 20, 2014 at 12:00 Chris asked Feb 20, 2014 at 11:52 ChrisChris 4532 gold badges15 silver badges31 bronze badges 3- Did you compare all WordPress files to a fresh download if anything differs? – kraftner Commented Feb 20, 2014 at 12:03
- There's a file called sunrise.php in wp-content. That had an empty line after the closing php so I thought removing that would solve it. It didn't. Interestingly, I put '123' directly after the closing php and that shows up on line 1 of the source, instead of the blank line. – Chris Commented Feb 20, 2014 at 12:18
- 2 Found it! there was a blank line in wp-config :) – Chris Commented Feb 20, 2014 at 12:20
4 Answers
Reset to default 1In this instance, there was a carriage return after the closing php tag in wp-config.
I know this has already been answered, but in case anyone else runs into it: if there is a ?>\n in any of the included files of the theme's functions.php or in functions.php itself at the very bottom, that can cause it as well.
Great current answers, but worth noting: My extra line breaks were hidden away in /wp-content/mu-plugins/custom-post-types.php
where I had setup some Custom Post Types. Once I deleted all characters after the closing ?>
and refreshed the front-end, everything works great!
Here is all the step, for each, check if there is not space or empty line before :
- in the root : check wp-config
- in your child theme : check functions.php, index.php, header.php
- in your parent theme : check functions.php, index.php, header.php
Next : deactivate all plugins : check if there is not space or empty line in the html source. If yes, activate your plugins one by one.
Next : Check your functions.php and all the included files. For each, check it.
本文标签: themesBlank line before doctype
版权声明:本文标题:themes - Blank line before doctype 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742353863a2459025.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论