Wordpress - Fatal error: Call to a member function get_var() on a non-object $wpdb
问题 [Solution by s_ha_dum on http://wordpress.stackexchange.com] I'm trying to direct users to a certain post based on a password entered in post settings. I have almost working code: Form on page: <form method="post" action=""> <input type="password" name="passwordfield"> <input type="hidden" name="homepagepassword" value="1"> <input type="submit" value="Submit"> </form> Code in functions.php function doPasswordStuff(){ if(isset($_POST['homepagepassword'])){ $post_password = $_POST[