WordPress.org

Ready to get started?Download WordPress

Forums

Server Error after trying to update the functions.php (9 posts)

  1. SarahKay
    Member
    Posted 1 year ago #

    I recently tried to remove the right sidebar on my homepage.

    I added:

    <?php
    add_filter( 'sidebars_widgets', 'disable_all_widgets' );

    function disable_all_widgets( $sidebars_widgets ) {
    if ( is_home() )
    $sidebars_widgets = array( false );
    return $sidebars_widgets;
    }
    ?>

    to functions.php as said in the tutorial, and updated the theme. It didn't really work as I hoped, so I tried deleting the same line and updating it, but instead I got the server error as below and can't access to my site.

    I get this message when I try to access to my site.

    Server error
    The website encountered an error while retrieving http://www.bpwebmedia.com/sara/wp-login.php. It may be down for maintenance or configured incorrectly.
    Here are some suggestions:
    Reload this webpage later.
    HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

    What should I do? Please help!

  2. riversatile
    Member
    Posted 1 year ago #

    Hi,

    Know that when you see ERROR 500, this can never comes from your files.
    Because it's a Internal Server Error (eg: Apache... etc)

    You can try to restore the previous functions.php and theme files, but I think the error will occur again.
    Did you know if that theme is compliant ? Is it come from http://wordpress.org/extend/plugins/ ? Because perhaps once you installed it, you were hacked !

  3. SarahKay
    Member
    Posted 1 year ago #

    Hi Riversatile, thanks for your reply.

    I know that it's not from the theme as I've tried it before on a different website and I never faced any problems with it. The theme I'm using is Custom Community.
    The minute I added that little piece of code in the functions.php the website broke!

    I am building this website for a university project which is due in two days, I'm really screwed and don't know what to do! :(

  4. wpcanyon
    Member
    Posted 1 year ago #

    1. Make sure there's no blank space after the closing php tag.

    2. Or remove the last closing php tag in functions.php, you don't need it.

  5. SarahKay
    Member
    Posted 1 year ago #

    Wpcanyon,

    Thanks for your reply,but how can I do that when I can't even enter the site now! Every page I enter is broken.

  6. wpcanyon
    Member
    Posted 1 year ago #

    FTP client.

    FileZilla is a good one.

    That way you can access the files on the server and modify them.

  7. SarahKay
    Member
    Posted 1 year ago #

    The problem is that it's a university project, I don't have access to the whole site, for example I can't put http://www.example.com in the host field cause I don't know what the password is! I only have access to http://www.example.com/sara!
    Sorry for troubling you but I'm really stuck and don't know what to do!

  8. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You need to contact someone with FTP access and ask them to activate the default theme on your site by renaming your current theme's folder inside wp-content/themes and adding "-old" to the end of the folder name.

  9. SarahKay
    Member
    Posted 1 year ago #

    Thanks a lot Esmi, Wpcanyon and riversatile for your help.
    I really appreciate it! I'll try and see what happens wish me luck.

Topic Closed

This topic has been closed to new replies.

About this Topic