There’s little difference between the files. When you view a WordPress page, the first file called is index.php. And it is, essentially, your “Method 1:”
1 2 3 4 | define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require ('./wp-blog-header.php'); |
The blog header file (that queues up the rest of WordPress) loads wp-load.php directly and fires up WordPress itself. Here’s most of wp-blog-header.php:
1 2 3 4 5 6 7 8 9 10 11 | if ( !isset($wp_did_header) ) { $wp_did_header = true; require_once( dirname(__FILE__) . '/wp-load.php' ); wp(); require_once( ABSPATH . WPINC . '/template-loader.php' ); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.