• Resolved Cubus

    (@wpcubus)


    I have a weird issue with a custom made child theme for the default Twentyten theme (shipped with WordPress 3.0).

    After I activate the child theme (without any warning) every “Publish” or “Save changes” action results in a blank page. At some times even logging in to the admin section results in a blank page too.

    This problem was solved after deleting the functions.php file I had included in my theme. First I thought I messed up something there, but even an empty functions.php file causes the same issue.

    I’m a bit clueless, because I used the same child theme on another wordpress setup without any problems. Only thing different in this case is that we setup wordpress as an MU platform.

    Anyone any thoughts on what could cause this issue?

    Problem is similar to: https://www.ads-software.com/support/topic/413853 but my server settings (PHP version, …) shouldn’t be any issue.

Viewing 15 replies - 1 through 15 (of 23 total)
  • Did you ever manage to resolve this? I’m getting the exact same issue, but on a normal WP install. White screen of death whenever I activate a child theme with ‘functions.php’ in it, or place that file into an active theme.

    I’ve resolved this by making sure no extra returns or lines are on the page after the last closing php tag “?>” in your functions.php file

    It just doesn’t like extra spaces/lines after it closes a function.

    Hope that resolves your issue!

    I’ve got a similar issue: I get syntax errors indicating functions have already been called. Any resolution to this? I have no extra returns or lines, just one or two functions. It’s all very simple but doesn’t work.

    @bionicsquid , link to the problem? Want to paste your functions?

    Sometimes, the typical fix (delete whitespace, close last PHP tag, etc) doesn’t work (I’ve found). There’s just something with the functions.php file.

    The Fix (sometimes): Open functions.php, copy everything, paste it to a new text document. Delete functions.php. Save the text document as functions.php.

    This has worked for us in the past.

    The problem may actually be that there are blank lines in the file and redirection won’t handle it well.
    https://www.cyberciti.biz/faq/php-redirect/ explains how they may interfere with any redirection code.

    Note that blank lines that are between <?php and ?> tags don’t make a difference: php preprocessor cleans them out before the http protocol level redirection takes place.

    This is also why New Nine Media’s fix works sometimes: the editor may trim empty lines from the end of the file. It won’t help with lines that are in the middle of the file though.

    Yup,
    Simply open up functions in text editer, and delete any whitespace at the end. If you try this in anything but a pure text editor you may still get the same problem.

    Although I have changed headers a few times I now am getting the following error codes:
    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 12288 bytes) in /home/leanonme/public_html/wp-includes/media.php on line 253
    And the other one is a security issue

    Does any one know about this…and how to fix it.

    Thank you,
    rdf

    Has anyone successfully gotten the child’s function.php file to work? I tried New Nine Media’s Fix to no avail. I have to get a client’s site working and this certainly doesn’t help.

    Bump on this question. I get the white screen with a single line functions.php. Absolutely no extra line feeds, carriage returns, etc. I tried deleting the file and putting a new one (again without extra lines) with no effect.

    ?<?php add_filter(‘widget_title’, ‘do_shortcode’); ?>

    When I go back to anything after the white screen, it seems to have been updated, but it happens all the time with many different parts of wordpress after functions.php is added to the child theme.

    Anyone have an idea?

    I’m having the same problem. Any suggestions?

    I haven’t worked on that site since the recent WP upgrade. However, with the previous version I was never able to find a solution and just had to do things without functions.php. Maybe this bump will bring in somebody with some insight.

    I’m using the most recent upgrade, and it’s still happening.

    If removing the ‘functions.php’ file from your child theme means you no longer see the WSOD, then definitely there’s a problem with your child theme’s ‘functions.php’ file. It might be, as some have pointed out, a simple matter of white space or empty lines. Or it could be that your code is incorrect (eg. a missing php end tag or possibly one too many). Or it could be that you’ve missed out on something, such as removing an action hook belonging to the parent theme and replacing it with a new function. I got the WSOD when I neglected to remove_action('widgets_init', 'twentyten_widgets_init' ); before defining new widget areas in my child theme’s functions. Remember that the child theme’s ‘functions.php’ always loads before the parent theme’s functions.php. Whether your installation is a single WordPress or MU or Multisite, the same rule applies. If your child theme’s ‘functions.php’ file is blank or empty, then it shouldn’t be there.

    In my case, I even tried uploading the original twentyten functions file (unchanged and untouched) directly from my hard drive. Still no go. There seems to be some systematic problem.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Functions.php on Twentyten child theme causes blank pages (MU setup)’ is closed to new replies.