Tag: ‘php’

WP: Ghost Lines

2010-03-24 by pubmed | Cats: Code | Tags: ,

Remove Blank Lines from XML Feeds

Recently set up this new WP site. All went typically well, until I checked the feed. Got this error:

XML Parsing Error: XML or text declaration not at start of entity
Location: http://pubmedia.us/feed/
Line Number 2, Column 1:

<?xml version=”1.0″ encoding=”UTF-8″?>
^

The prob was a blank line at the top of the feed, which XML will not abide (the XML declaration goes “in the first position of the first line”). That blank was shooting from an addition I’d made to functions.php , written like this:


Powered by Web Design Company Plugins