Ajax, etc. If you want to use the functionality of the $ wpdb
Categories: memorandum function
2011-01-06 Last update:
2010-12-27: Sun Posts
If you want to use the $ wpdb in a manner different from normal access, etc. the use of Ajax, you will be able to use it to load the following files.
// $wpdbを利用する $path = 'WordPressのルートパス'; include_once($path.'wp-config.php'); include_once($path.'wp-load.php');
後は通常どおり「 global $wpdb; 」とグローバル宣言して使います。
どこかの英語サイトでこの方法を見つけたのですがどこだったか忘れました…けど感謝。




























