Created
June 7, 2015 21:54
-
-
Save krusynth/a2a711c941123beee296 to your computer and use it in GitHub Desktop.
Use Wordpress login system on a custom PHP page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example of php code using Wordpress' login. | |
*/ | |
require_once '../pages/wp-blog-header.php'; | |
// If the user is not authorized, redirect to the Wordpress login. | |
auth_redirect(); | |
// Your code here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You must set the following values in your wp-config file. | |
// Your domain name. | |
define('WP_HOME', 'http://pltrust.dev.krues8dr.com/' ); | |
// Path to wordpress. Leave this as an empty string if you've installed | |
// it in the root. | |
define('WP_SITEURL', WP_HOME . 'wordpress' ); | |
// The root path. This needs to be a level that includes both the custom | |
// PHP page and Wordpress itself. | |
define( 'COOKIEPATH', '/' ); | |
define( 'SITECOOKIEPATH', COOKIEPATH ); | |
define('ADMIN_COOKIE_PATH', COOKIEPATH); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment