WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] functions.php (empty) causes Child to fail. Why?

[Resolved] functions.php (empty) causes Child to fail. Why?

  • My child theme works fine with just the one file (styles.css) in the directory.

    As soon as I add functions.php, it no longer works. Funny thing, even an empty functions.php or one with just <?php ?> and nothing more will cause the theme to fail.

    How does it fail?

    When you click on UPDATE, whether for adding posts/categories or editing, it returns a blank page. No errors. You just get a blank page. I’ve tried different browsers also just to make sure.

    Weird!

    Anyone ever hear of this happening…and why?

    TIA

Viewing 3 replies - 1 through 3 (of 3 total)
  • The problem is if there are any blank lines in the functions.php file.

    Make sure there are no blank (empty) lines following the last line of code.

    🙂

    Moderator Jan Dembowski

    @jdembowski

    Brute Squad and Volunteer Moderator

    That’s probably it. Don’t close the functons.php file just make it something like

    <?php
    // Your PHP goes after here

    See if that does it for you.

    As posted prior, you simply need to be sure there are no empty lines at the end of the file.

    All is good now. Thx.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] functions.php (empty) causes Child to fail. Why?’ is closed to new replies.
Skip to toolbar