WordPress Error Thrown: Call to Undefined Function
Suddenly I began receiving a “call to undefined function” error when accessing my website. The admin section worked without issue, and there were no changes to the website aside from the automatic updates, but the website decided to no longer function correctly.
The full error message was as follows:
Error thrown
Call to undefined function lighthouse_posted_on()
The fact that the function lighthouse_posted_on()
was in the error message was a pretty great clue: for some reason my theme-specific function was not being found, which points fingers toward the issue being with my theme rather than the WordPress install.
Note: if you’re seeing a WordPress specific function in the error, it’s likely that your automatic install failed and you should try manually installing the latest version again.
Verifying Your Theme Parent Theme
I’m using the lighthouse theme which I customized through child theming. After realizing the issue had to be with my theme, I navigated to Appearance -> Theme
in the WordPress admin and noticed a parent/child theme related error at the very bottom stating:
ERROR: The parent theme is missing. Please install the “Lighthouse” parent theme.
This was verified when I looked for the theme and couldn’t find it anywhere. Somehow, the Lighthouse parent theme was deleted!
WordPress conveniently provided a button to download and install the theme again. After doing so, I was able to re-activate my child theme, which immediately resolved the Call to Undefined Function error, making my website accessible once again.
Hi, I’m Sam.
I’m a programmer and a DIYer. When I’m not finding things to build I enjoy cooking, hiking, camping and traveling the world with my best friend. Say Hello!