Hi all — I’m tweaking an existing wordpress theme to suit my needs (with little or no html, css or php experience — yikes), but I’m really trying to give each of my issues an honest go before I post here for help. I don’t want to abuse these forums! That having been said:
My RSS feeds for both posts and comments appear to be broken, and clicking on the "subscribe" returns this error message:
XML Parsing Error: XML or text declaration not at start of entity
Line Number 3, Column 1:
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
I thought it would lead me to an rss file that I could start poking around in, but all the rss-related php files in my blogosaur.com/ directory are just redirects, and I cant figure out where they’re redirecting to (they look like this:)
Anybody have any insight to get this working? The weird thing is, I switched the theme this morning to see if that would fix the problem (it has with some other stuff, giving me clues on where to start hunting for answers) and the RSS feeds worked briefly! They kept working when I switched back for a short period, then stopped again. Repeating my theme-switching tactic failed to repeat this result. A hallucination, perhaps?
Site is at: http://www.blogosaur.com/
It looks like the file that’s giving me trouble is my feed.rss2.php file in my wp-includes directory. I think? But the theoretically offensive lines of code read
as displayed in my error message. I’ve tried messing around with it to no avail (not surprising since all of my tweaking is pure speculative experimentation), and also pasting in a supposedly curative code snippet that I found here: http://www.w3it.org/blog/wordpress-feed … on-how-to/
No progress yet. My research leads me to believe that the problem could be extra spaces in my code somewhere (which is what the solution at the link tries to fix). Anybody have any insight?
Probably a silly question but have you tried this http://feedvalidator.org/docs/error/WPBlankLine.html
No, that actually helps a lot! According to the validator I’ve got a spare line at the beginning of my feed, but I have no idea how it’s getting there. I’ve been going over my rss-related php files, my wp-config file and my functions.php file, but haven’t found anything that seems to be helping.
The feeds still work in google reader, it turns out, and probably some others. But I know I need to get rid of that extra line if I want to be rid or the error message when you click on my rss feed button.
The only thing I can think of now, and you’re gonna hate me for this, is a clean install.
It sounds like you’ve been messing about with some of the core files, maybe try replacing just the files you have been working on.
Otherwise, backup your posts, do a clean install check the rss works, activate your theme, check again, activate your plugins, check again, import your backed up posts, check again etc.
Yeah, I think I’m going to have to try that at some point — it’s not the posts I’m worried about, because this is a pre-launch site that I’m building from the ground up. It’s all the tweaking I’ve done on the theme so far.
Another thought — when I view the source code of my main page, it has that extra line at the top, just like my feed does. I can’t find it in my header or page templates — surely this is a symptom of my overall problem.
I just tried switching to the default theme, and now my rss feed validates — my confusion on this before stems from the fact that the feed apparently doesn’t update until I add a new post, so I was still getting the error when I switched themes, and thinking the problem wasn’t fixed. What I needed to do was validate the theme instead. Also, in the default theme that spare line is gone from my main page source code.
So it’s definitely something in my theme throwing that extra line up. I think this theme was broken when I got it.
My functions.php file is very, very short. Do you see anything wrong with this?
‘before_title’ => ‘
Provided there is no space before or after that code, then I stand corrected.
Then the only other thing I can think of that is specific to a theme that might affect it is the header.php. Compare that to the header.php in the default theme, is there anything obviously different?
I’m clutching at straws here. Can you tell? :D
Well, my header.php file doesn’t have a <?php /* theme name */ ?>line like the default, but adding one doesn’t help. I checked several themes, and some have it, some don’t.
The first line in my header is
and yet in my source code for the page, there’s an extra, blank line above this (which goes away when I switch themes). I guess wordpress uses pretty much all of the php files in my themes folder to generate page code, but what would stick a blank line at the very to of my pages, and at the top of my rss code?
I appreciate, by the way, all your insight to which straws I should try grasping at. :)
IT’S TOTALLY IN MY FUNCTIONS.
I’m just not sure where — but replacing my functions file with the default theme one fixes the problem (both in the feed and the page code) of course it screws my sidebar all up.
‘before_title’ => ‘
So I have no extra spaces before of after this in my file — does this file call information from other places that could be screwing it up? Iget the following errors when I try to validate it:
‘before_widget’ => (
# Error Line 5, Column 27: character “‘” not allowed in prolog
‘after_widget’ => ‘
# Error Line 6, Column 27: character “‘” not allowed in prolog
‘before_title’ => ‘
# Error Line 7, Column 26: character “‘” not allowed in prolog
‘after_title’ => ‘
# Error Line 9, Column 3: end of document in prolog
Aren’t those apostrophes supposed to be there, though? Or is the apostrophe the crux of the biscuit> :shock:
You must be logged in to reply to this topic.