Support » Themes and Templates » Various White Screens with Child Theme functions.php

  • I asked here, but haven’t seen any replies.

    If I make a child theme of twenty ten everything works great with plugins, css, replacement templates etc. However, as soon as I add any kind of functions.php to the child theme folder, I get all kind of white screen problems that vary depending on the functions.php.

    Two cases:
    1) Copy the twenty ten functions.php exactly as it is into the child theme folder: everything goes white. Can’t load any wp-admin pages. Site itself is a white page.

    2) Use a very simple functions.php as follows:

    <?php
    if (!is_admin())
      add_filter('widget_title', 'do_shortcode', 11);
    ?>

    Things seem to work, but actually any page/post updates and other types of events will result in a white screen. Using the back button shows that updates were made, but getting a whitescreen all the time is annoying and worrisome. Worse is that the login screen does not work any more. As long as I stay logged in, I can work. But the log in page changes to a white screen with this little piece of garbage characters: “” (not sure if that will be reproduced accurately).

    Any helpful advice?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Yeah i had the very same problem, did an exact copy in to child theme folder for twenty ten, and its would not let me see wp-admin.

    So i just deleted everything and just put what i needed in <?php ?>

    But mine seems to be working fine now.

    However for you i was thinking about this,

    Maybe if you just put the whole functions.php file in the child theme folder with all the changes and deleted the default functions.php from the default twenty ten folder it might work like normal.

    just everytime you update wordpress you would need to delete the default functions.php

    Thanks for the idea. I tried it, but I seem to get the same results as I did before. Just to confirm (php noob here), I added my code immediately after the opening <?php of the original as follows:

    <?php
    if (!is_admin())
    	add_filter('widget_title', 'do_shortcode', 11);
    /**
     * TwentyTen functions and definitions
     *
    ...

    Is that the right place?

    For reference, I tried deleting the twentyten functions.php and putting the same file into my child theme and it works normally.

    well im a php noob aswell, but as for me this is what my line fo code for functions.php is Here

    and really that shouldn’t matter where it is in the <?php ?>

    As for the reference yeah that would work, but did you edit a copy of the original default functions.php and put your code into it, as if you were editing it. Then put that edited functions.php in the child theme folder. Then delete the functions.php in the default twentyten theme so there is only one functions.php which will be in the child theme folder.

    haha

    Yes, I did exactly as you suggested and got the results written above (i.e. same results as with child functions.php unfortunately).

    It seems like it would be a major bug if this is normal behavior. So therefore it seems like I must be missing something. Argh.

    I can’t help but I got to agree. I am experiencing a lot of wierdness in child functions.php in the default.

    Yeah well i guess we will have to work around it for now.

    Just to be clear if anyone else reads this. There is no workaround currently. Any help or suggestions are still appreciated.

    I hope some one reports this in the trac

    The functions file in the parent theme stays active, you don’t need to copy it to the child theme.

    Thanks for the reply Rich. I think all of us here did that originally as it should be done, but we ended up with white screens and so the whole “delete the original from the parent theme”, etc. are attempts at finding a workaround (so far unsuccessful for me).

    @niericentral Check that <?php is first line no blank line before it

    As code posted above seems as if you have blank line and then <?php

    Thanks for the suggestion govpatel. I should have mentioned before that after reading somewhat similar problems I made sure there is no whitespace before or after the simple php code that I pasted above. So specifically, there is no new line/etc. before or after that code.

    Ah! I forgot to mention an important point (I will update the original post) that the code I pasted above does actually work. So I am able to put shortcodes in the titles and they function correctly. It just also causes these other problems.

    edit: It seems I can’t edit the original any more? So this will have to do.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Various White Screens with Child Theme functions.php’ is closed to new replies.