Posted By

benjaminpearson on 01/05/10


rss wordpress xml

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Wordpress RSS XML Space Error

 / Published in: XML


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

  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();

Report this snippet  


RSS Icon Subscribe to comments
Posted By: on September 4, 2018

the 8 best 1080p tv for gaming

You need to login to post a comment.