How do I call the basic WordPress header files? -


i'm making custom form action.php , looks this:

<?php // collect data $first      = $_post["first_name"]; $last       = $_post["last_name"]; $email      = $_post["email"]; $pass       = $_post["password"]; $pass2      = $_post["confirm_password"]; $cat        = $_post["category"]; $tandc      = $_post["terms_and_conditions"]; $privacy    = $_post["privacy_policy"]; $newsletter = $_post["newsletter"]; die(); ?> 

essentially nothing going on - problem though when want call wordpress hook such this:

$user_name = $email; $user_id = username_exists( $user_name ); 

it returns error:

fatal error: call undefined function username_exists()...

i'm aware there header files not calling 'undefined function' run.

i have tried adding @ top of page: wp_head(); - following error:

fatal error: call undefined function wp_head()

include wp-load.php file (in root of wordpress installation) in php script file so,

require_once("/path/to/wordpress/wp-load.php"); 

you have provide abspath of wp-load file, can use functions of wordpress in php script.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -