WordPress.org

Ready to get started?Download WordPress

Forums

[closed] Error message "Parse error" (18 posts)

  1. John Lyman
    Member
    Posted 2 years ago #

    After I inserted a code into the function.php file my site will not open. The following code is the error message.

    Parse error: syntax error, unexpected '<' in /home/content/54/7433054/html/wp-content/themes/thejournal/functions.php on line 28

    I have the function.php file open but I can't edit posts or click off the site or I won't be able to access the function.php file again.

    Any help fixing this would be great. The original code that created this issue was supplied by WordPress to tweak the WooDojo tabbed widget.

  2. genusone
    Member
    Posted 2 years ago #

    It's because there is a "<" in the code that shouldn't be there, maybe you pasted <?php by accident.

    If you have edited the code in WP, you are not going to be able to make the change in there. You will have to overwrite the file using an FTP client.

    I can't really tell you the issue if I can't see the code

  3. John Lyman
    Member
    Posted 2 years ago #

    Below is the code as it currently stands in the function.php file:

    /*-----------------------------------------------------------------------------------*/
    /* Start WooThemes Functions - Please refrain from editing this section */
    /*-----------------------------------------------------------------------------------*/

    // Set path to WooFramework and theme specific functions
    $functions_path = TEMPLATEPATH . '/functions/';
    $includes_path = TEMPLATEPATH . '/includes/';

    // WooFramework
    require_once ($functions_path . 'admin-init.php'); // Framework Init

    // Theme specific functionality
    require_once ($includes_path . 'theme-options.php'); // Options panel settings and custom settings
    require_once ($includes_path . 'theme-functions.php'); // Custom theme functions
    //require_once ($includes_path . 'theme-plugins.php'); // Theme specific plugins integrated in a theme
    //require_once ($includes_path . 'theme-actions.php'); // Theme actions & user defined hooks
    require_once ($includes_path . 'theme-comments.php'); // Custom comments/pingback loop
    require_once ($includes_path . 'theme-js.php'); // Load javascript in wp_head
    require_once ($includes_path . 'sidebar-init.php'); // Initialize widgetized areas
    require_once ($includes_path . 'theme-widgets.php'); // Theme widgets

    /*-----------------------------------------------------------------------------------*/
    /* End WooThemes Functions - You can add custom functions below */
    /*-----------------------------------------------------------------------------------*/

    <?php?>

  4. John Lyman
    Member
    Posted 2 years ago #

    Any help sorting this out would be immensely appreciated. I thought at this point I would be able to add the code without any issues but I will have to resort to paying a WP expert to tweak certain files on my site.

    The code above is the whole code as it appears in the function.php file.

  5. genusone
    Member
    Posted 2 years ago #

    If that is exactly how your functions.php file looks, then the problem is at the bottom. The file should look like this...

    <?php

    *** CODE ETC HERE ***

    ?>

    And from what I see your file looks like this...

    *** CODE HERE ***

    <?php?>

    I hope this helps

  6. John Lyman
    Member
    Posted 2 years ago #

    So I should add <?php at the top?

  7. John Lyman
    Member
    Posted 2 years ago #

    So this would be the correct entire code?:

    <?php
    /*-----------------------------------------------------------------------------------*/
    /* Start WooThemes Functions - Please refrain from editing this section */
    /*-----------------------------------------------------------------------------------*/

    // Set path to WooFramework and theme specific functions
    $functions_path = TEMPLATEPATH . '/functions/';
    $includes_path = TEMPLATEPATH . '/includes/';

    // WooFramework
    require_once ($functions_path . 'admin-init.php'); // Framework Init

    // Theme specific functionality
    require_once ($includes_path . 'theme-options.php'); // Options panel settings and custom settings
    require_once ($includes_path . 'theme-functions.php'); // Custom theme functions
    //require_once ($includes_path . 'theme-plugins.php'); // Theme specific plugins integrated in a theme
    //require_once ($includes_path . 'theme-actions.php'); // Theme actions & user defined hooks
    require_once ($includes_path . 'theme-comments.php'); // Custom comments/pingback loop
    require_once ($includes_path . 'theme-js.php'); // Load javascript in wp_head
    require_once ($includes_path . 'sidebar-init.php'); // Initialize widgetized areas
    require_once ($includes_path . 'theme-widgets.php'); // Theme widgets

    /*-----------------------------------------------------------------------------------*/
    /* End WooThemes Functions - You can add custom functions below */
    /*-----------------------------------------------------------------------------------*/

    ?>

  8. genusone
    Member
    Posted 2 years ago #

    Yep, that's right!

  9. John Lyman
    Member
    Posted 2 years ago #

    Still getting the error message. This sucks. I have to overwrite the file using an FTP client?

  10. genusone
    Member
    Posted 2 years ago #

    Yes, because of the error the WP interface will not work. So you have to use FileZilla or something to overwrite the file.

  11. John Lyman
    Member
    Posted 2 years ago #

    Are there directions online? I really have no clue about how to do this. I really appreciate the help. This experience is maddening.

  12. genusone
    Member
    Posted 2 years ago #

    1. Download FileZilla
    2. Connect to your server using FTP login details provided by your host.
    3. Go to your theme's folder i.e. /wp-content/themes/YOUR THEME
    4. Then download your functions.php file and open with notepad
    5. Make the change to the file as above
    6. Replace the file with your correct copy

    That should do it

  13. John Lyman
    Member
    Posted 2 years ago #

    Sorry for my mundane question but can I contact you through email about paying you to do this if I provide the login info? I don't quite trust myself to do this.

  14. genusone
    Member
    Posted 2 years ago #

    No problem. Go to my website Here and you will see an email address at the top next to the logo.

  15. John Lyman
    Member
    Posted 2 years ago #

    Actually I called GoDaddy and you wouldn't be able to do anything with it because I don't know my FTP password.

  16. genusone
    Member
    Posted 2 years ago #

    Oh no! Can they not reset it for you?

  17. John Lyman
    Member
    Posted 2 years ago #

    I sent you an email on your website. I actually have other tweaks once I get this sorted out that I could use your services. The company I usually use is extremely busy.

  18. keesiemeijer
    moderator
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic