I’ve a strange problem with an Autofocus theme.
In my templates file, header.php, I’ve a code like this (and is correct)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
When I look at the source code of the generated HTML, I found something like this
[blank]
[blank]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
The extra blank lines are breaking my RSS feeds…
Other info:
- No filters on the content except wpautop
- functions.php doesn’t do anything on the content
- Plugins All In One Seo, WP Stats, Smiley Remover, SEO Friendly images
Any clues?
the_content
doesn’t affect theDOCTYPE
and<html>
tags, only the post/page content.One of your plugins, or something else in the theme is either throwing an error, or is printing something earlier than it should.
Have you tried:
define( 'WP_DEBUG', true );
to look for errorsI believe the problem is that there are not any
<?php
opening tags in your header.php so the space is probably coming from your templates that call<?php get_header(); ?>
Try adding a commented out header like so:
It’s also possible that you have windows line endings which sometimes get parsed as a dbl line ending adding an extra space to each line.