Ooops I broke my WordPress RSS feed

WordPress Logo

I had edited the functions.php file to add a ‘read-more’ link to the end of post snippets instead of the […] text.

Inadvertently I had added a new line outside of the php closing tag at the end of the file. As this file is included when rendering RSS feeds it created a blank line before the opening RSS tag – and any whitespace before the opening tag renders the XML document invalid… doh. It’s fixed now of course.

function new_excerpt_more($post)
return '... ' . 'read more' . '';
add_filter('excerpt_more', 'new_excerpt_more');
Published on: 24th July 2010
Categorised in: code
Tagged with: rss, wordpress, xml
Team players: Peter

leave a reply

Your email is never published nor shared. Required fields are marked *