• Resolved Mr. FI

    (@mr-fi)


    Hello,

    I was trying to edited some excerpt code in the functions.php and must have added a comma, or who knows, anyway the whole site crashed after I updated. I had kept my backup file and put that back on the server through my FTP. The site works again and I can access my admin area. Everything works except I can’t get into the widgets or the theme editor without getting the error:

    Parse error: syntax error, unexpected ‘<‘ in /home/fibigsky/public_html/wp-content/themes/point/functions.php on line 277

    Why is this happening only when accessing widgets/theme editor? Any way to fix it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • J M

    (@hiphopinenglish)

    You will need to look in the functions.php file around line 277, and check your syntax for a floating <. Until we can see some code, we won’t be able to help much. You may even see the problem straightaway when you look in this file.

    Thread Starter Mr. FI

    (@mr-fi)

    function mts_excerpt($limit) {
    $excerpt = explode(‘ ‘, get_the_excerpt(), $limit);
    if (count($excerpt)>=$limit) {
    array_pop($excerpt);
    $excerpt = implode(” “,$excerpt);
    } else {
    $excerpt = implode(” “,$excerpt);
    }
    $excerpt = preg_replace(‘[[^]]*]‘,”,$excerpt);
    return $excerpt;
    }

    This is the code starting at line 277. Like I said, I tried to edit this before, messed it up, reverted back to the original (seen here) but it still won’t allow me to edit the theme from inside the admin panel of WP.

    Thread Starter Mr. FI

    (@mr-fi)

    Update: Everything is working again now. Maybe it needed time to refresh on the server?

    J M

    (@hiphopinenglish)

    If it stays working, please mark this as resolved. Remember also to paste code snippets in bacticks like so:

    <?php
    $my_code = awesome;
    ?>

    So it formats nicely (Helps to spot syntax errors too).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Broke functions.php, had backup, site works but can't access editor’ is closed to new replies.