WordPress.org

Ready to get started?Download WordPress

Forums

Help! Broke my Graphene themed site trying to work with the "functions.php" file (9 posts)

  1. rseaver06
    Member
    Posted 2 years ago #

    Ok, I could about die right now. I've been working on this site for a very long time and thought I could make a small modification to add buttons shortcode. Well after copying and pasting the existing code into a .txt file as a back up, I placed the code where I thought it was supposed to go and got some strange code on the top of my admin area. Decided I didn't want to mess anything up and pasted the original code back into the functions.php and now am getting a syntax error and can't get back to where I was.... HELP

    The error I get is "Parse error: syntax error, unexpected '<' in /data/20/1/148/112/1963275/user/2143947/htdocs/wp-content/themes/graphene/functions.php on line 2383"

    the site is located at http://www.ketsdeverconstruction.com

    Any help would be greatly appreciated!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Your only real option is to upload a copy of the original functions.php file from a fresh download of Graphene.

  3. rseaver06
    Member
    Posted 2 years ago #

    I was afraid of that. Is that going to undo any of the changes I've made? Also, any idea why this would happen if I directly copied and pasted the original code as a back-up?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Is that going to undo any of the changes I've made?

    Yep - that's why we try to advise people to create child themes whenever possible. All we can say about your current situation is that you have still either added - or omitted - something small but critical in your theme's functions.php file.

  5. Josh (WP Edit)
    Volunteer Moderator
    Posted 2 years ago #

    esmi is right. This is exactly why we strongly encourage the use of a child theme for site modifications.

    Also, you can use the Graphene support forum to benefit from a large community of all Graphene users. I moderate on the forum, and we give specific instructions for properly setting up a child theme.
    http://forum.khairul-syahir.com/graphene-wordpress-theme/

  6. rseaver06
    Member
    Posted 2 years ago #

    Sorry guys, I've been trying to figure out child themes for a while for this very reason but I've just been a little stumped. So here's another interested bit, when I look at the code I copied OUT of the functions.php before editing it there are thousands of lines of code. The fresh functions.php has less than a hundred. What's going on there?

  7. Josh (WP Edit)
    Volunteer Moderator
    Posted 2 years ago #

    The number of functions in the main functions.php file was reduced in the last version because it became overwhelmingly difficult to maintain.

    Instead, it's broken into about ten different functions files, dependent on their specific functionality, and referenced from the main functions.php file.

    Yet another reason to be using a child theme for modifications ;)

  8. rseaver06
    Member
    Posted 2 years ago #

    Ok, thanks so much Josh. Since there's been a drastic change to the functions I'm going to have to completely re-install the theme not just the functions.php now aren't I?

  9. Josh (WP Edit)
    Volunteer Moderator
    Posted 2 years ago #

    Well, staying up to date with a theme is always a good practice. Especially with themes in active development, such as Graphene.

    The last two versions of Graphene have really altered the functionality and customization possibilities (ie custom column widths, improved functions, etc.).

    I'm not sure which version you are using... but I would suggest updating to the latest version before beginning your customizations. And also make sure you do them from the child theme.

Topic Closed

This topic has been closed to new replies.

About this Topic