WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Changed the functions.php and now my blog is blank. (20 posts)

  1. rubykp
    Member
    Posted 1 year ago #

    I'm new to codes and blogging. I simply wanted to get an extra sidebar. I went into functions.php and made a little change and now my blog is blank. Can't even log in. Please tell me I will see everything in my blog again. :(

    Here is the code I made changes to:
    /**
    * Register our sidebars and widgetized areas.
    *
    * uses register_sidebar
    * returns the id
    */
    if ( function_exists( 'register_sidebar' ) ) {
    register_sidebar ( ( array(
    'name' => __( 'sidebar', 'simplecatch' ),
    'id' => 'sidebar',
    'description' => __( 'sidebar', 'simplecatch' ),
    'before_widget' => '<div class="widget">',
    'after_widget' => '</div>',
    'before_title' => '<h3>',
    'after_title' => '</h3><hr/>'
    ) );
    }
    ?>

    I'm using the simplecatch theme. :(

  2. leejosepho
    Member
    Posted 1 year ago #

    Are you running a Child Theme?

    Do you have FTP access?

    When I have had that kind of trouble, I restored the changed file and all was well again.

  3. rubykp
    Member
    Posted 1 year ago #

    I don't know how to run a child theme.

    and I'm just barely trying to set up the ftp thing.

    I'm clueless :(

  4. gidd
    Member
    Posted 1 year ago #

    You can just try to remove the code block that you changed inside functions.php to see if it comes back. Then ask for another support to add a sidebar.

  5. leejosepho
    Member
    Posted 1 year ago #

    Just four months ago, I had never even heard of FileZilla.

    You will get your site back by putting an original copy of functions.php back in by overwriting the one you have changed. There is more than one way to do that, but FTP is probably the simplest. Download a new copy of your theme to somewhere on your own computer, then copy/replace its functions.php into your current theme folder. After you get things running again, you will find it is much easier to make a Child Theme than what you are facing right now.

  6. rubykp
    Member
    Posted 1 year ago #

    You mean the code I just posted here? Remove all of that?

  7. gidd
    Member
    Posted 1 year ago #

    Yes, just cut it out and put it in a plain text file in your local computer.

  8. rubykp
    Member
    Posted 1 year ago #

    I cut it out. It's still the same. Can't log in. Blank page.

    I have filezilla up and running but I have no idea how to connect.

  9. leejosepho
    Member
    Posted 1 year ago #

    Do you have your login info for your server?

    You will possibly have to tell FileZilla to show hidden files, not sure there.

    Look for your wp-content folder. You theme should be inside a "themes" folder in there. After you locate functions.php inside your theme folder, upload and overwrite it with a default one. Trying to re-edit the file already there will require a proper editor, and I use Notepad++. Also, be sure to never have or leave any space or line break at the close of a .php file.

  10. rubykp
    Member
    Posted 1 year ago #

    finally got into filezilla. i found where it says admin-functions.php and uploaded the recently installed simple catch functions php

    how do i overwrite?

  11. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Admin-functions is not the same as functions.php.

    Download a new copy of your theme to your local computer. Then using Filezilla, upload and replace the functions file that you changed inside the simple catch themes folder. See if that allows you to login again.

  12. leejosepho
    Member
    Posted 1 year ago #

    i found where it says admin-functions.php and uploaded the recently installed simple catch functions php

    how do i overwrite?

    You were in the wrong place, and it sounds like you are fortunate.

    Do what WPyogi just said.

    Edit: Filezilla will ask you for confirmation to overwrite when you upload if you are where you need to be.

  13. rubykp
    Member
    Posted 1 year ago #

    yes it did ask about overwriting and i clicked ok. I checked my blog and it's still blank. is there something else i need to do?

  14. leejosepho
    Member
    Posted 1 year ago #

    If the functions.php file is the only file you had altered, putting it back to its original state is all I know. So, sit tight and wait for an expert to come around...

  15. rubykp
    Member
    Posted 1 year ago #

    maybe i installed the wrong version of my theme? could that be why?

  16. leejosepho
    Member
    Posted 1 year ago #

    Since I know nothing about your theme, I dare not comment there...and you might want to post that question here:
    http://wordpress.org/support/theme/simple-catch

  17. rubykp
    Member
    Posted 1 year ago #

    OMG I finally did it! I was uploading the wrong functions.php!

    My blog is back. :)

    THANKS so much guys for your responses. I just learned so much about codes, ftps, and filezilla. I'll never ever ever touch functions.php again. :)

    I don't even want an extra sidebar anymore.

  18. rubykp
    Member
    Posted 1 year ago #

    marking as topic resolved... THANKS again!!

  19. leejosepho
    Member
    Posted 1 year ago #

    Cool beans, and now please make a Child Theme. You can run your regular theme while changing anything you wish in the Child Theme, and then it only takes a few completely-safe seconds in "Live Preview" mode to see whether you get a white screen or something really great.

  20. rubykp
    Member
    Posted 1 year ago #

    I will for sure... learned my lesson now.

Topic Closed

This topic has been closed to new replies.

About this Topic