How to load wordpress environment without loading the template?
Basically I want to use wordpress functions for example wp_create_user()
or wp_update_user()
outside of wordpress (outside of wordpress directory).
I tried with all the below code snippets to load the wordpress environment, I am able to use the functions correctly in both the cases but the problem is that this also loads the wordpress template which I do not want.
First Method:
?php
define('WP_USE_THEMES', false);
require ('../blog/wp-load.php');
?
Second Method:
?php
define('WP_USE_THEMES', false);
require ('../blog/wp-blog-header.php');
?
Directory Structure:
/blog
|
|_ Wordpress installed here
/admin
|
|_ admin.php (I want to use wp functions here)
Note: I am using Writr theme in my wordpress blog.
Topic wp-blog-header.php wp-load.php outside-wordpress Wordpress
Category Web