Support » Fixing WordPress » using child theme, functions.php error?

  • I already messed up my entire wordpress site trying to fix and figure this out myself and had to reinstall wordpress and build the site overso i will leave it to the experts…

    I keep getting this error SOMETIMES… when you reload the page a few times, this error will pop up. It doesn’t pop up all the time though. Is that normal to only have an error pop up SOMETIMES and not other times randomly?

    Warning: fopen() [function.fopen]: Filename cannot be empty in D:\Hosting\9324857\html\wp-includes\functions.php on line 4452

    Warning: fread() expects parameter 1 to be resource, boolean given in D:\Hosting\9324857\html\wp-includes\functions.php on line 4455

    Warning: fclose() expects parameter 1 to be resource, boolean given in D:\Hosting\9324857\html\wp-includes\functions.php on line 4458

    I am running a child theme off the Twenty Eleven theme. I made a child theme folder and added a styles.css with my edits to the CSS… what is this error talking about? I am assuming it is about the functions.php file? What’s wrong with it? I did not touch anything in the original folders and files besides my simple Child Theme which doesnt even have functions.php inside it. Everything it in it’s right folder and file as it was not touched since I installed it fresh.

    the site i am talking about is:
    raygreavesart.us

Viewing 2 replies - 1 through 2 (of 2 total)
  • I keep getting this error SOMETIMES… when you reload the page a few times

    I tried several page loads in quick time and did not get any error, the pages load fast so it is not timing, are you logged in as admin when it happens or as a visitor.

    The error is generated by the function get_file_data, reading the comments it is likely a plugin that is causing it.

    /**
     * Retrieve metadata from a file.
     *
     * Searches for metadata in the first 8kiB of a file, such as a plugin or theme.

    Something is passing in an empty filename as these are the lines, it is trying to open and close an empty file

    // We don't need to write to the file, so just open for reading.
    	$fp = fopen( $file, 'r' );
    
    	// Pull only the first 8kiB of the file in.
    	$file_data = fread( $fp, 8192 );
    
    	// PHP will close file handle, but we are good citizens.
    	fclose( $fp );

    HTH

    David

    wrona

    (@wrona)

    Oh, and I thought it was something with the functions.php file being misplaced or corrupt… who knew… I actually disabled all my plug ins and it went away! So it WAS a plug in. Not as serious as I feared!

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘using child theme, functions.php error?’ is closed to new replies.