Return to Snippet

Revision: 22182
at January 5, 2010 01:42 by benjaminpearson


Updated Code
// find these lines in the php file (ie, feed-rss2.php)
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
$more = 1;

// immediately add these 3 lines after
$out = ob_get_contents();
$out = str_replace(array("\n", "\r", "\t", " "), "", $input);
ob_end_clean();

Revision: 22181
at January 5, 2010 01:41 by benjaminpearson


Initial Code
// find these lines
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
$more = 1;
// immediately add these 3 lines after
$out = ob_get_contents();
$out = str_replace(array("\n", "\r", "\t", " "), "", $input);
ob_end_clean();

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

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

Initial Title
Wordpress RSS XML Space Error

Initial Tags
wordpress, xml

Initial Language
XML