• Resolved mwiegant

    (@mwiegant)


    Hey all, I’ve been trying to troubleshoot a broken RSS feed on my wordpress site.

    I’m using a custom theme for my site, and that appears to be the issue. When I switch the theme to one of wordpress’s built-in themes (twenty fourteen, twenty thirteen, etc), the RSS feed properly displays. The problem is that I can’t find any documentation for what my issue might be, and I don’t know what code, if any, I’m supposed to have in my custom theme to make the feed work.

    If I could get some advice, especially on what code is needed to make an rss feed work on a custom theme, that would be SUPER fantastic ??

    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • RSS Feeds should work automatically on custom themes.

    Looking at the page source (view-source:https://blog.ustyme.com/feed/ on Chrome), it appears there are 6 empty lines before the first line of XML that could be causing the issue. There may be some hidden characters in a script somewhere that affects the RSS feeds that’s causing the feed to break.

    Do you have any code in your theme would affect how the feed is generated? If you’re a bit more technically inclined, I’d check out this script: https://jimbojw.com/wiki/index.php?title=How_to_find_PHP_files_with_trailing_whitespace to see if you can locate any files in your theme that may have trailing whitespace after PHP closing tags.

    Thread Starter mwiegant

    (@mwiegant)

    Chris, thanks for your reply.

    I ran the script on the post you linked and found that my index page had an extra line after the last closing php tag. I also looked at the remaining files manually, in case the script missed any (which it did, about 6 files), and I made the changes to remove the extra lines in those files. Those changes don’t seem to have effected my rss-feed output, unfortunately. The empty lines that you pointed out are still there.

    Do you have any other suggestions? Is there anything you can tell me about how / where wordpress sets up the RSS feed?

    Thread Starter mwiegant

    (@mwiegant)

    It seems that I was able to fix the broken feed! It seems like my specific issue with having empty lines in my functions.php file between php code blocks.

    To future readers: The links below were helpful for me, or were helpful to some other people who ran into this EXACT same type of problem. Methodically check any file with php code in it for extra lines at the end of the file.

    This link will have you add a new file to your page (worked for most people, but not for me)

    This is the article I followed that led me to solving the issues that existed in my code.

    chriswgerber

    (@chriswgerber)

    Thanks for posting your fix! Those sneaky white space characters have broken so many things.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The RSS Feed on my custom theme is broken?’ is closed to new replies.