Wordpress RSS XML Space Error

/ Published in: XML
Save to your folder(s)

Allows you to remove the whitespace that can appear before the xml tag in wordpress files such as wp-includes/feed-rss2.php

Copy this code and paste it in your HTML
  1. // find these lines in the php file (ie, feed-rss2.php)
  2. header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
  3. $more = 1;
  5. // immediately add these 3 lines after
  6. $out = ob_get_contents();
  7. $out = str_replace(array("\n", "\r", "\t", " "), "", $input);
  8. ob_end_clean();

URL: http://www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.