• This is for a nonprofit org’s website. I just inherited and saw this error:

    Parse error: syntax error, unexpected T_ENDFOREACH in comments.php on line 45.

    Line 45 would be:

    <?php endforeach /* end for each comment */ ?>

    I search that code and the error message, but didn’t find solutions that worked. Any help appreciated!

    [Large code excerpt removed by moderator per forum rules. Please use the pastebin for all large code excerpts. It works better anyway.]

Viewing 7 replies - 1 through 7 (of 7 total)
  • What were you doing when you saw this error? Is it showing up in the front end or you see it in your error logs?

    Thread Starter meryl

    (@meryl)

    It shows up on a blog entry’s page (page.php). It also screws up the admin menu at the top (hidden) yet post shows “edit this entry”.

    Didn’t see anything in page.php either.

    Here’s the comment.php code

    Please try deactivating plugins to rule out any plugin-related issues and activate an unmodified default theme to rule out theme-related issues. What WordPress version are you on?

    Thread Starter meryl

    (@meryl)

    No change after deactivating all plugins.

    Narrowed down to a theme issue. Changing themes made error disappear.

    v3.9.2

    Wow, Jetpack won’t even connect to wordpress.com. Says site_inaccessible. Deactivating Jetpack changed nothing.

    Thread Starter meryl

    (@meryl)

    How is the error in the theme? Usually theme is just .css not .php?

    Themes contain all the front end page php files.

    Thread Starter meryl

    (@meryl)

    I fixed it by copying 2014 theme into the Dead Silent theme while retaining the top portion of Dead Silent. Theme works well for our purposes. The others don’t feel the style or require a lot of tweaking to fix. Hence the reason we prefer to stick with an older theme.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Parse error: T_ENDFOREACH’ is closed to new replies.