+ Reply to Thread
Results 1 to 4 of 4

Thread: How to Edit Corrupted Files in WordPress PHP Code?

  1. #1
    Hosting Master johnwest is on a distinguished road
    Join Date
    May 2014
    Location
    India
    Posts
    159

    How to Edit Corrupted Files in WordPress PHP Code?

    How to Edit Corrupted Files in WordPress PHP Code? Especially while updating new post.

  2. #2
    Hosting Master sarawills is on a distinguished road
    Join Date
    Oct 2014
    Location
    India
    Posts
    168
    If the faulty file has whitespaces, the easiest way to solve the issue is to manually edit the issue via an FTP or a File Manager. You can start from line # mentioned in the error message, then look through the rest of the file for any unnecessary spaces.

    Make sure to pay attention to the beginning and end of PHP tags. There should be no spaces before the <?php tag or after the closing ?> tag and file’s last line of the code.

  3. #3
    Hosting Master smartbrian is on a distinguished road
    Join Date
    Oct 2014
    Location
    India
    Posts
    130
    Most text editors can remove whitespaces automatically. Alternatively, you can use online whitespace removal tools like TextFixer and Code Beautify to do the job for you.

  4. #4
    HWHT Addict rossmn is on a distinguished road
    Join Date
    Apr 2020
    Location
    Hyderabad
    Posts
    31
    It is easy to fix it. All you need is to log in to your cPanel, not ftp. And now, please go to the file manager there and then, public_html/wp-content/themes/colormag. there you will see the functions.php. You can edit this file right there by right-clicking and choosing “Edit”. There you won’t get this error what you are getting in FTP/in the editor. Do you remember what you did in that functions.php? If not, still there are ways to restore that functions.php.


    First of all, go to your wordpress dashboard and then appearance->themes->add new. and now, you should install and activate a new theme but please don’t customize it. Now, go to file manager in cPanel-> public_html/wp-content/themes/
    and delete the theme “colormag”. things are done. Go back to the wordpress dashboard once again and reinstall and activate the colormag again and delete the other theme, now you will get a new and fresh copy of functions.php.


    I hope this will solve your problem.

+ Reply to Thread

Similar Threads

  1. Can we add code files of different languages in App_Code folder?
    By ajaxdns in forum Programming Discussion
    Replies: 0
    Last Post: 06-11-2019, 11:05 AM
  2. Can we add code files of different languages in App_Code folder?
    By gitanistone in forum Programming Discussion
    Replies: 0
    Last Post: 02-06-2019, 06:14 AM
  3. How to add input field in wordpress edit page?
    By sonikathakur in forum Programming Discussion
    Replies: 1
    Last Post: 08-21-2018, 04:43 AM
  4. How to edit Google Plus Profile URL..?
    By neshajha in forum Search Engine Optimization
    Replies: 1
    Last Post: 03-12-2018, 08:34 AM
  5. what kind of software you used to edit html/php file
    By kawoyip in forum Web Design and Content
    Replies: 17
    Last Post: 08-01-2012, 06:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts