1

Our site has a category feed URL and it is giving an an error if tried to generate a SimpleXMLElement.

http://www.e4s.co.uk/blogs/employers/category/articles/feed/

I validated the URL at http://validator.w3.org/appc/ and it is showing that blank lines at the beginning is the issue.

How can I remove the blank lines. I mean in which file do i need to change ?

Manojkumar
  • 1,351
  • 5
  • 35
  • 63

1 Answers1

1

To remove the white space, look at your theme's header.php and remove any white space you see at the top of the file. It should ideally only contain <?php on the first line of the document and no white space between the closing ?> and your DOCTYPE declaration, e.g.

<?php
/**
 * header.php
 */
?><!DOCTYPE html>

<!-- rest of file... -->


Looking at a content page on your site, I see there's no closing </body> or </html> which leads me to believe that your template is missing a get_footer(); call or footer.php is incomplete.

stealthyninja
  • 10,343
  • 11
  • 51
  • 59
  • @NaanuManu -- Let's chat about this further: http://chat.stackoverflow.com/rooms/18998/room-for-stealthyninja-and-naanumanu – stealthyninja Nov 02 '12 at 22:42
  • 1
    As @stealthyninja said, it's not just the header than can mess this up, I had a `content-single.php` file in a child theme, with a gap *after* the initial PHP tag but before the opening `
    `, which broke all RSS feeds (symptom: Firefox thought they were a "Safari document" and would refuse to open them itself.)
    – William Turrell Mar 07 '16 at 19:52
  • 1
    Also: omit closing PHP tags from files like `functions.php` to avoid introducing a blank line at the *end* of a file which will end up at the *start* of your theme… – William Turrell Mar 07 '16 at 20:04