WordPress.org

Ready to get started?Download WordPress

Forums

HELP! Syntax error on Widgets php, the whole site can't display (8 posts)

  1. hagu
    Member
    Posted 3 years ago #

    I got this error message after attempting to edit on my widget.php:

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home2/cheryla3/public_html/wp-content/themes/brand/functions/widgets.php on line 26

    I tried to open the pages and all the pages are down with only the error message shown.

    I googled and can't locate the error. Someone says sudden parse error could be hacking. I hope that's not the case.

    Below is my widget.php,

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Anyone can help???

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Try re-uploading a fresh copy of the theme.

  3. hagu
    Member
    Posted 3 years ago #

    I can't access any of the pages nor the dashboard.
    What should I do???

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    FTP into your site (or use whatever file management application your host provides) and rename you current theme's folder in wp-content/themes. That should activate the Twenty Ten theme and allow you access to your dashboard again.

  5. hagu
    Member
    Posted 3 years ago #

    Does this mean whatever I did on the website would be lost?
    I don't have access to the website's FTP unfortunately, I just do the coding on the WordPress part.
    I did install a wordpress backup plugin. But will I lost the content or the stylesheet of the website?

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    Does this mean whatever I did on the website would be lost?

    Your site's main content is quite safe in your database. The only thing that you might lose is any widgets that you added to the sidebar whilst using the (now) faulty theme. However, if you install a fresh copy of the faulty theme, you may be able to retrieve your widgets when you successfully re-activate it.

    But will I lost the content or the stylesheet of the website?

    It won't be lost. It will be inactive but still present via the Appearance -> Editor page. I'd suggest copying it and saving the copy on your computer before you try to re-upload the theme.

  7. hagu
    Member
    Posted 3 years ago #

    Thanks for the info.
    But what caused this error? I thought even if something in the code was wrong, I can still see the page, but not in the way I want.
    Did I do something that's terribly wrong? Or it's a server issue?

  8. esmi
    Forum Moderator
    Posted 3 years ago #

    I thought even if something in the code was wrong, I can still see the page, but not in the way I want.

    Some PHP coding errors stop the page display completely. Like this one...

Topic Closed

This topic has been closed to new replies.

About this Topic