Failed include in functions.php only when not logged in to wp-admin

What issue or error are you experiencing?

I updated one of the theme files in 'app\public\wp-content\themes\cyberresillience'. The site works fine if I happen to be logged on to wp-admin. But if I’m not logged in to wp-admin, I get the following error:
[19-Dec-2024 11:34:21 UTC] PHP Warning: include(C:\Users\XXX\Local Sites\cyberresilience-dec24\app\public/wp-content/themes/cyberresillience/d4r-gf-after-submission.php): Failed to open stream: No such file or directory in C:\Users\XXX\Local Sites\cyberresilience-dec24\app\public\wp-content\themes\cyberresillience\functions.php on line 436

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

Replace a theme file with a different version. While logged on to wp-admin, browse to the page in question. Everything works fine. Log off wp-admin, and the error occurs.

System Details

  • Local Version:
    Version 9.1.0+6719
  • Operating System (OS) and OS version:
    Windows 11 Enterprise

Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

local-lightning-verbose.log (362.8 KB)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @briansheehan

If it works fine when you’re logged into admin but breaks outside of admin, that might indicate a caching issue, which would be the easiest thing to check. You’ll want to look around for plugins that have a cache to flush or a Regenerate CSS option. The same goes for the theme. You might also need to flush your browser cache.

If none of the caching troubleshooting resolves the problem then there might still be a pathing issue or some other conflict at play here.

1 Like

Hi Nick, yes that seems to have been the issue. Cleared the WP Rocket cache and now everything works fine again. Thank you!

1 Like

Glad to hear that @briansheehan! Thank you for the follow up!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.