I have a folder in the root directory of a wordpress site. As such, wordpress seems to be bypassed (the intended result), but now I want to add functionality to the discreet module (code inside the directory located in the wordpress root) to check if we are logged into wordpress or not… can this be done?
Clarification of folder structure
/wp-admin/
/wp-content/
index.php
... (all wordpress files)
/my-folder/ <~ I want to access via http://mysite.com/my-folder/
index.php <~ I want a line of php to check if user is logged in to wordpress or not
style.css
To do this you need to include/require the file “wp-blog-header.php” located with all the word press files and use the WorldPress function “is_user_logged_in()” which returns a boolean value, for more details see the WorldPress PHP Code here.
So you could use a function like this one in your file /my-folder/index.php to check if the user is logged into your WorldPress