Wordpress file loading
This is the order of loading of files when Wordpress loads up. I’m assuming a default installation and this is according to 1.3alpha4 as pulled from CVS.
Start up sequence (no templates):-/index.php |-- wp-blog-header.php |-- wp-config.php | set MySQL settings and language |-- wp-settings.php | set various variables... |-- wp-includes/wp-db.php | create the wpdb class | set table names |-- wp-includes/functions.php |-- wp-includes/functions-compat.php |?-- wp-admin/upgrade-functions.php |-- wp-include/class-IXR.php |-- wp-includes/functions-formatting.php |-- wp-includes/functions-post.php |-- wp-includes/classes.php |-- wp-includes/template-functions.php |-- wp-includes/template-functions-general.php |-- wp-includes/template-functions-links.php |-- wp-includes/template-functions-author.php |-- wp-includes/template-functions-post.php |-- wp-includes/template-functions-category.php |-- wp-includes/template-functions-comment.php |-- wp-comments.php |-- wp-includes/links.php |-- wp-includes/kses.php |-- wp-includes/wp-l10n.php | check if installed |-- wp-includes/vars.php |-- wp-includes/version.php |-- my-hacks.php |-- wp-content/plugins/* // all active plugins | register a shutdown hook |-- wp-includes/wp-l10n.php // none of this is working yet. |-- /wp-config.php (require_once) | and set locale from above, default US |-- wp-includes/stream.php |-- wp-includes/gettext.php | define gettext like functions |-- locale.php | handles path-info and URL handling, 404 redirect | set vars, send HTTP headers, get settings from DB | construct query, get result | do a template redirect based on query. | |-- wp-header.php |?-- header.php if exists |:-- else echo HTML headers section down to div id=content | | output the posts and lots of other sorts of stuff | |-- wp-footer.php |?-- footer.php if exists |:-- else |-- wp-sidebar.php |?-- sidebar.php if exists |: -- else show sidebar | echo end of body and HTML
The order when using templates is very similar to the above (unless you do something in the template that specifically modifies the order).

