{"id":747,"date":"2009-05-07T18:03:17","date_gmt":"2009-05-07T17:03:17","guid":{"rendered":"http:\/\/west-penwith.org.uk\/blog\/?p=747"},"modified":"2014-04-11T18:26:02","modified_gmt":"2014-04-11T17:26:02","slug":"rss-feed-fixed","status":"publish","type":"post","link":"https:\/\/west-penwith.org.uk\/blog\/archives\/747","title":{"rendered":"RSS feed fixed"},"content":{"rendered":"<p>I have finally figured out why the RSS feed on this blog had died. I had been assuming that it was due to an illegal character in one of the post headings because that is what broke it last time; XML is very fussy about character set.<\/p>\n<p>Today I had a look at the source of the XML that wouldn&#8217;t display and spotted that there were two blank lines on the front. Removing those (by hand) fixed it, I said XML was fussy!<\/p>\n<p>Now where were they coming from. A search on Google for &#8220;wordpress xml blank lines&#8221; came up with a few suggestions and it looks like it is a common problem but everyone has to figure it out for themselves; there is no FAQ. The prime suggestion was blank lines on the end of the wp-config.php file but that wasn&#8217;t the case for me. The next was in functions.php in the theme; BINGO. I am always very verbal when writing code and put in lots of comments and white space. Normally that doesn&#8217;t matter but functions.php is loaded for every action (even for the admin panels) and PHP is a strange beast&mdash;everything that is not with us is against us; i.e. everything that is not a PHP statement is directly output to the stream so blank lines before the first < ?php and after the last ?> is output and you cannot separate the functions outside of the PHP structure either. Once I had fixed that then it was all ok.<\/p>\n<p>I still can&#8217;t figure out the source of the two blank lines that cause the Comment feed to fail! [Update: that is fixed too. Same problem, just that I hadn&#8217;t properly cleared the browser cache.]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have finally figured out why the RSS feed on this blog had died. I had been assuming that it was due to an illegal character in one of the post headings because that is what broke it last time; XML is very fussy about character set. Today I had a look at the source [&hellip;]<\/p>\n","protected":false},"author":239,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,10],"tags":[],"class_list":["post-747","post","type-post","status-publish","format-standard","hentry","category-technical","category-wordpress"],"_links":{"self":[{"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/posts\/747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/users\/239"}],"replies":[{"embeddable":true,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/comments?post=747"}],"version-history":[{"count":3,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/posts\/747\/revisions"}],"predecessor-version":[{"id":1729,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/posts\/747\/revisions\/1729"}],"wp:attachment":[{"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/media?parent=747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/categories?post=747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/west-penwith.org.uk\/blog\/wp-json\/wp\/v2\/tags?post=747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}