• Resolved M1chel

    (@m1chel)


    Hi,
    I have a problem that seems to affect many users: I get an error message when I try to validate my feed for feedburner.
    It says that I have some blank lines before the XML declaration.

    This feed does not validate.

    *

    line 1, column 1: Blank line before XML declaration [help]

    It suggests to check the wp-atom, wp-rss2, wp-config files or theme specifics like th functions.php
    I know it’s not fault of my plugins coz it didn’t validate also without plugins.
    When I first checked I had 13 blank lines, then I erased some from the function file and now I have only 2.

    I’m not sure where else to check, however can you take a look at my functions.php to see if I’m missing something?
    Or do you have a solution to fix the lines?

    [code moderated]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Please don’t post huge chunks of code here. For larger blocks of code, use the WordPress pastebin. It makes life easier for everyone.

    The url of your site would be more helpful…

    Thread Starter M1chel

    (@m1chel)

    Hi Esmi, sorry I didn’t know about pastebin.
    Here’s my code https://wordpress.pastebin.ca/1541609 , now you can moderate my previous post if it’s possible.

    the url of my site is https://designerbreak.com

    You have some white space or invisible formatting characters at the very top of your RSS feed. From what I can tell, these are coming from your theme’s header.php file as your web pages also demonstrate the same opening ‘blank’ lines.

    Try editing header.php and removing everything before:

    <!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    Thread Starter M1chel

    (@m1chel)

    uhm, I edited the header.php and also my custom home.php where the only thing before the doctype was

    <?php
    /**
    Template Name: header
     */
    ?>

    now it’s gone but my problem is still there..
    Any other advice? can you spot something else?

    thank you!

    The lines/invisible characters are still there – which means that this could be coming from another WordPress file. You may have to start going through every file looking for blank lines either before the opening <?php tag or after the closing ?> tag. ??

    Thread Starter M1chel

    (@m1chel)

    I looked for a while into the problem and I couldn’t find which file was affecting the feed.
    Finally I used this solution: https://stiern.com/tutorials/no-more-invalid-rss
    Yesterday I tried the same thing but with the .htaccess file and I damaged something important which got me to reinstall wordpress.
    I suggest you modify just the index file like described on that site.

    Thanks Esmi for your time.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Invalid feed, blank lines, function.php’ is closed to new replies.