[Resolved] Problem with Functions.php

Home Forums Support Problem with Functions.php

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #306091
    Christa Hutchins

    I tried to do something I’m completely unqualified to do … adding a snippet of code at the end of functions.php I had just updated to the lasted versions of GP and GP Premium and everything was working.

    I put a } on the next line below the last end if, then pasted the snippet below that. When hit Update, I got this error:

    Parse error: syntax error, unexpected ‘}’ in /home/doanfnkl/public_html/wp-content/themes/generatepress/functions.php on line 730

    So I deleted everything I added and tried to update again and got the same error.

    Now the site is down and everything I try to do in the Admin panel gets the same error.

    How do i fix it?? I’ll need step by step instructions, please.

    #306093
    Tom
    Lead Developer
    Lead Developer

    Hi Christa,

    PHP can be pretty dangerous sometimes.

    What you’ll need to do:

    1. Login to your hosting control panel (cPanel).
    2. Open the “File Manager”.
    3. Navigation to “wp-content/themes/generatepress/functions.php”.
    4. Remove the custom code you added and save.

    To add PHP in the future, it’s best to use a plugin like Code Snippets: https://docs.generatepress.com/article/adding-php/

    Also, no need to add that } character.

    Hope this helps – if you can’t find the file manager, it’s best to call your hosting and they should point you in the right direction.

    #306097
    Christa Hutchins

    Fixed!! I will never venture to that dark and scary place again! LOL! Thanks for the help, as always 🙂

    And the Code Snippets plug in helped me do exactly what I needed to do!

    #306125
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.