One way of killing the WordPress RSS-feed bug

As with all blogs you want a working RSS-feed. RSS is a good thing, as long as they validate. If they don’t validate, they suck. One day I ran into a nasty bug that killed my RSS-feed. Everything looked just fine so the problem wasn’t in the RSS-function itself since it did generate the RSS-feed. The validator told me the feed began with a blank line, which is a big no-no. So I began looking thru all the files for my theme and in functions.php I found the little bastard that killed my feed. Between two php-tags I found the blank line.

So, this is what I found…

...
</div>
<?php } ?>

<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_title' => '<h2>',
...

… and removing the blank line…

...
</div>
<?php } ?>
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_title' => '<h2>',
...

…made the RSS-feed validate.

Jay!

Kommentarer



*