• I made an edit to my template, index.php, this morning. When I updated, the following error appeared (though the template said it updated successfully):
    Warning: fread(): Length parameter must be greater than 0. in /home/jason/public_html/blog/wp-admin/templates.php on line 110
    But index.php is now completely blank, and I can’t make changes to the template — when I do, that same error appears, and the template is blank. I add code, update it, and it blanks itself.
    This basically means my site’s inaccessible, and I can’t fix the template. What happened? How do I fix this? Is my template recoverable?
    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Are you trying to edit index.php within wordpress?
    Try editing with an outside program or text editor?
    Do you have a backup?

    Thread Starter jgurley

    (@jgurley)

    I was editing index.php in WordPress. Big mistake: there’s no backup. index.php actually doesn’t even appear on my FTP server, so I can’t snag the file.
    I don’t know what happened. But I’m guessing my only option is to recreate the template. Which is fine, but WordPress erases its contents and gives me that error if I touch it at all.
    Jg

    Hmm, it sounds like your index was deleted inadvertantly somehow. Perhaps it was moved from your root directory on the FTP server somehow?
    Look around your ftp and see if you can find it.
    I always keep a local backup just incase! But I have never had anything like that happen

    Thread Starter jgurley

    (@jgurley)

    I’ve looked for it — it’s gone.
    What worries me more, though, is that I can’t edit the template in WordPress without getting that error, and without WP erasing the template. Any ideas about that?
    Jg

    Thread Starter jgurley

    (@jgurley)

    …I mean, that error makes it sound like there’s an error in the actual template.php file. I don’t know how to fix something like that. Ideas?

    Thread Starter jgurley

    (@jgurley)

    Okay, I still want to know what was happening, but the problem seems to somehow have solved itself — my index is restored, and the error is gone. Still: wtf?
    Jg

    If there was no sign of the index.php file on your webhost one day and it suddenly reappeared another day; then it sounds like your host might have been having problems and restored your site from a backup. You might try asking your webhost to see if they know what’s going on.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Template blanked itself! Site showing up empty’ is closed to new replies.