connecting to DB from custom php file
You’re must load WP-load function To do that you need to require wp-load file, so if, your custom file is in theme it shoudl look like somethink like that: $wp_load = ‘../../../../../wp-load.php’; if ( file_exists( $wp_load ) ) { require_once( $wp_load ); }else{ die(‘no-load’); } You could also set const SHORTINIT to true to minimalize … Read more