WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] I added a line of CSS in my functions.php page and now my site is inaccessible!

[Resolved] I added a line of CSS in my functions.php page and now my site is inaccessible!

  • Good evening,
    I am hoping someone can help me. I am somewhat new to WordPress, and am working freelance for a client doing her site. In trying to fix thumbnail sizes in my galleries (a whole other issue worth another post), I was given this line of code by a friend:
    .gallery-icon img { width: 100%; height: auto; }
    I added it to my style sheet, and it fixed my problems for the most part, but some thumbnails in my galleries were still overlapping and were mis-sized…so I took it upon myself to experiment with code.
    Instead of entering .gallery-icon img { width: 100%; height: auto; } into the style sheet only, i thought it might help to enter it into the function.php page as well. I entered it, and clicked update, and the page went blank.

    I then tried accessing the site, and it only brings me to a white page, or a error 404 message.
    I just want to go back in and delete that single stupid line of code from the function.php sheet but I can’t even get back into the Dashboard/editor, I can’t even log in!

    How can I fix this???? I need help ASAP, I know I might have to explain this to her tomorrow, but I would appreciate having a fix before then.
    going to annepfaff.com/wp-login or wahtever that login page is, it won’t even let me access that!

    Help please!!
    Thanks so much and sorry for the whiney tone!

    Dyl

Viewing 7 replies - 1 through 7 (of 7 total)
  • Chris Olbekson

    @c3mdigital

    Level 12 Bug Squasher & Forum Moderator

    Instead of entering .gallery-icon img { width: 100%; height: auto; } into the style sheet only, i thought it might help to enter it into the function.php page as well. I entered it, and clicked update, and the page went blank.

    You can’t enter css directly into a php file. It causes a fatal error. Also just by putting it into functions.php it is not going to do anything because it will never be output for the browser to read unless you wrap it in style tags inside a function definition and attach it to a hook.

    The ONLY way to fix your problem is to downloaded function.php via ftp and edit the file in a text editor and re uploading it. It is possible that your hosting control panel has a built in editor you can use. You need to remove the lines of css you added.

    I can not even log in to wordpress to upload or change any of the code. How can I fix it then????
    The site is hosted by BlueHost and I logged into that to try and see if there was some way to access the code through the hosting site. Could this be a way?
    Basically, Im curious how I can fix this??? do you know if bluehost has a built in editor?
    thanks so much for your time!

    /Users/student/Desktop/Screen Shot 2013-02-07 at 12.21.46 AM.png

    WPyogi

    @wpyogi

    Forum Moderator

    Do you have FTP access? Or via BlueHost’s file manager? You should be able to download and fix that file — then put the corrected one back. If you can’t sort out what you changed, download a new copy of the theme to your local computer and use the unchanged functions file from there to upload back to the site.

    Chris Olbekson

    @c3mdigital

    Level 12 Bug Squasher & Forum Moderator

    That screenshot looks like you might be able to edit the files but I can’t really tell. And yes doing a restore from before the file was edited should fix your problem. Your hosting support might be able to help you with this. I would try opening a ticket with them if you can’t get it figured out.

    AH ITS FIXED!!!! THANK GOODNESS!!!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] I added a line of CSS in my functions.php page and now my site is inaccessible!’ is closed to new replies.