Support » Fixing WordPress » can’t get feed to work

  • This code:

    <a href="feed:<?php bloginfo('rss2_url'); ?>"><image src="" alt="add rss feed" title="add rss feed" /></a>

    generates a url such as:

    Theoretically there is some rewriting going on to get this translated into wp-feed.php, but all I get is an error page in Safari and a bad XML page in FireFox.

    Any help appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The error is due to a new line getting added to the very start of your feed document (RSS is an XML format that requires a document begin with <?xml and nothing else). If you look at the source of that page, you’ll see an empty line at the top.

    You’ll also find the extra line in the source of your blog pages as well.

    Often this is caused by a plugin or some other script echoing a newline. So a good first step to tracking it down is to turn off any plugins you’re currently running.

    the feed starts with a blank line.

    Odds are, you have a plugin that has a blank line before the opening <?php or after the closing ?>. Your mission is to find that plugin and fix it!

    [edit: 20 seconds. dangit!]

    Ok, I tried shutting off *all* plugins and the problem persisted. I checked every PHP file and none have leading space prior to the <?php or trailing space after the last ?>. Any further thoughts regarding how best to find the errant blank line?

    Update. I punted trying to hunt the errant space down and did this: I edited wp-rss2.php, inserting the following code:

    At the very top:

    function clean_spaces($buffer)
    return trim($buffer);

    At the very bottom:


    This takes a blunt instrument approach to chomping any leading or trailing whitespace. The feed works in FireFox and NewsFire reader. It fails in Safari and IE 7.

    I’m an RSS noob so please forgive what are probably old questions…


    *hands cwd a hammer

    Yep, that’s a blunt instrument approach, but it seems to have worked.

    Running your feed through the validator only shows one type of error and that will be cleared up when you upgrade to 2.0.5.

    In an ideal world, perhaps that upgrade may help with your extra cr/lf issue(?).

    Well, I fixed that validation nit as well, and all my feeds are now passing the W3C validator. But… only ATOM is displayed at all in Safari. FireFox is fine, IE 7 gets most of the feeds. Not Safari.

    I know this isn’t a WP problem, but does anyone know why Safari would give an error on these? BTW: I’ve used this release of Safari on other RSS feeds no prob.


Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘can’t get feed to work’ is closed to new replies.