WordPress.org

Ready to get started?Download WordPress

Forums

Child theme functions.php and invisible characters causing errors. (2 posts)

  1. Paal Joachim Romdahl
    Member
    Posted 1 year ago #

    Hi

    I am building a child theme and it contains a functions.php with multiple hooks and filters. I have noticed that if i give the code some space in between other codes a slowdown occurs when I activate or deactivate plugins. I get a white blank screen so that I need to click the browsers back button. I have checked online and read that it is an error in WordPress causing this blank white screen.

    I had to smack the code together and then take it all out and paste one code in at a time. In the end I was able to get it working just fine. Activating and deactivating plugins worked smoothly again. Just the next time I add new code I am worried that the error will begin acting up again.

    I do hope there is a good solution to this. I would like to have a comment line between the code to make it better visually.

  2. Paal Joachim Romdahl
    Member
    Posted 1 year ago #

    I found the answer to this puzzle.

    My functions.php file contained too many php open and close tags.
    For every section of code I had an open and a close tag.
    There is no need for this. It is a lot simpler.

    Just one open php tag is needed (if no extra html code to be outside of the php tag is added). So all the open and close tags were removed except the initial php opening tag. From having a bunch of open and close tags I was left with only one php tag at the top.

Topic Closed

This topic has been closed to new replies.

About this Topic