• I have been writing a custom PHP script that is included in the theme header.php file. The script simply connects to the database to return a couple rows of data. It works successfully when I am logged into WordPress admin, but does not load at all when logged out and viewing the site as an anonymous user. I cannot even get the script to return a basic echo 'test'; unless I am logged in.

    Has anyone ever seen or heard of this issue before? Any help would be appreciated so I can stop hitting my head against the keyboard.

Viewing 1 replies (of 1 total)
  • Probably your script is wrapped inside other script which checks if user is logged in. Try to put your script on some other place and see how it will work.

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Include Only Working When Logged In’ is closed to new replies.