parse error
-
Hi Guys,
Newbie here, having problems with parse error:
Parse error: syntax error, unexpected ‘www’ (T_STRING), expecting ‘,’ or ‘;’ in D:\home\site\wwwroot\articles\wp-content\themes\atahualpa\functions\bfa_header_config.php on line 163
Below is the code:
echo ‘<td ‘ . $header_rowspan . ‘valign=”middle” class=”logoarea-logo”>‘;
echo ‘<img class=”logo” src=”‘.$logo . ‘” alt=”‘;
bloginfo(‘name’);
echo ‘” /></td>’;
}Could anyone tell me what is incorrect?
thanks
-
What you have there can’t be where the error is. The error says
unexpected ‘www’ (T_STRING),
There’s no “www” anywhere in the code that you’ve shown us there.
But…
Having looed at that, it’s really not done the right way. It should be something more like this:
echo '<td ' . $header_rowspan . 'valign="middle" class="logoarea-logo">'; echo '<img class="logo" src="' .$logo . '" alt="' . get_bloginfo('name') .'" /></td>'; }162 echo ‘<td ‘ . $header_rowspan . ‘valign=”middle” class=”logoarea-logo”>’;
163 echo ‘<img class=”logo” src=”‘ .$logo . ‘” alt=”‘ . get_bloginfo(‘name’) .'” /></td>’;
164 }Now looks like this but still getting same error at:
There’s something strange going on. As I said before, your code doesn’t have “www” anywhere, and that’s what the error says is breaking it. Most times when I’ve seen this it’s been because the file is formated a little differently, or the old version of the file is still on the server.
Can you post the entire file to pastbin so we can see exactly what’s happening with it? (of course, remove any sensative info before you do)
Hey Cat,
Thanks for taking the time to look at this,
have copied the full header_config file to:
The error is on line 208. No idea why your server is reporting the wrong line – but it looks like you haven’t got the latest file uploaded to the server.
This is line 208. Notice thw ‘www’ in there, and look just before it…
echo 'href="http://' . ($bfa_ata['feedburner_old_new'] == 'New - at feedburner.google.com' ? 'feedburner.google.com/fb/a/mailverify?uri=' : 'www.feedburner.com/fb/a/emailverifySubmit?feedId=') . $bfa_ata['feedburner_email_id'] . '&loc=' . get_locale() . '" title="' . $bfa_ata['email_subscribe_link_title'] . '">' . $bfa_ata['email_subscribe_link'] . '</a>';You can’t join string using a semi-colan, so that’s where your error is.
great, so how should that read for the page to work again?
It should be a full-stop, not a semi-colan. Like the rest of the string joins in that same bit of code.
echo ‘href=”http://’ . ($bfa_ata[‘feedburner_old_new’] == ‘New – at feedburner.google.com’ ?
‘feedburner.google.com/fb/a/mailverify?uri=’ . ‘www.feedburner.com/fb/a/emailverifySubmit?feedId=’) .
$bfa_ata[‘feedburner_email_id’] . ‘&loc=’ . get_locale() . ‘” title=”‘ .
$bfa_ata[’email_subscribe_link_title’] . ‘”>’ . $bfa_ata[’email_subscribe_link’] . ”;
}have changed the full colon to full stop but still having same issue
it’s the $logo variable on line 163 as the error implies
unexpected t_string can be a wrong var type
it’s currently defined on line 160:
$logo = $imgdir.$bfa_ata['logo'];try echoing that variable out, if you find out it’s an array print_r it to see whats in it
Wherever that code came from, it’s really terrible, and it looks like it doesn’t do what it’s meant to.
I’m guessing that’s from a theme that you’ve purchased somewhere? Just a quick search for the header function name brings up a commercial organisation that does “hands-free” theme coding… I hate to say it, but this is why I don’t use services like that. They never work quite as well as they are meant to. You should contact them to get support for this as if it really is a problem like this, then they’ll need to know about it to fix stuff for anyone else that uses this.
Hi Bernbe01
Thanks for isolating the problem, not sure what echoing the variable out means
on line 161 put:
echo "Echoed var: " . $logo; echo "<pre>"; print_r($logo); echo "</pre>";if you still can’t find the proper var name, try doing the same code changes for the $imgdir and $bfa_ata vars
i agree with catacaustic that if this is not a customization you are applying to the theme it needs the theme devs to fix this for you
yeah I have no idea what that means, I added it to 161 but no change
Probably should get a coder to help you if you don’t want to contact the devs
The jobs forum would be a great resource for this
Here’s the developer’s site for that theme:
http://forum.bytesforall.com/forumdisplay.php?f=38
Or just download a new copy of it here:
The topic ‘parse error’ is closed to new replies.