WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Uh Oh! Crazy Error, Site is Down (3 posts)

  1. punkoblog
    Member
    Posted 6 years ago #

    So I was trying to edit formatting.php to change the default excerpt from 55 to 35, I just changed the numbers and uploaded the file. Afterwards I get this error:

    Parse error: syntax error, unexpected T_LNUMBER in /mnt/gs02/herd02/26608/domains/kindletank.com/html/wp-includes/formatting.php on line 98

    So I thought, well I will just change it back. Still get the error. I even uploaded a fresh copy of the file, and still the error shows up. I cannot even get into my dashboard.

    Any Ideas?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    I even uploaded a fresh copy of the file, and still the error shows up.

    Are you using any sort of caching plugins? Or a browser cache? Have you tried hitting refresh a few times?

    Or perhaps your fresh copy wasn't all that fresh?

    Failing all else, redownload the ZIP file from here and get a known good copy of the file, then upload that.

    Also, never hack the core files. Find another way. In this case, the other way would have been:
    a) Copy the whole wp_trim_excerpt function into your theme's functions.php file, but with a new name like my_trim_excerpt.
    b) Modify your function to do 35 instead of 55.
    c) Add these lines to the theme's functions.php file as well:

    remove_filter('get_the_excerpt', 'wp_trim_excerpt');
    add_filter('get_the_excerpt', 'my_trim_excerpt');
  3. punkoblog
    Member
    Posted 6 years ago #

    Thanks for your help!

    I have been reminded that when troubleshooting a problem, often times simple fixes are often hurried. At first when you said

    "Or perhaps your fresh copy wasn't all that fresh?"

    I thought to myself, "well yah", and moved on to other issues. So I wasted another 30 minutes.

    Ultimately I found that I was uploading an edited copy of formatting.php when I thought it was untouched. I fixed the problem by redownloading wordpress, and replacing the whole "includes" folder.

    Voila!

    Thanks again!

    Roman Craigle

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags