Use load_template().

git-svn-id: https://develop.svn.wordpress.org/trunk@2023 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2004-12-30 21:58:01 +00:00
parent a7c5546375
commit 4553f8cef0
2 changed files with 7 additions and 10 deletions

View File

@ -1649,7 +1649,7 @@ function load_template($file) {
extract($wp_query->query_vars); extract($wp_query->query_vars);
include($file); require_once($file);
} }
function add_magic_quotes($array) { function add_magic_quotes($array) {

View File

@ -3,27 +3,24 @@
/* Note: these tags go anywhere in the template */ /* Note: these tags go anywhere in the template */
function get_header() { function get_header() {
global $wpdb, $wp_query;
if ( file_exists( TEMPLATEPATH . '/header.php') ) if ( file_exists( TEMPLATEPATH . '/header.php') )
require_once( TEMPLATEPATH . '/header.php'); load_template( TEMPLATEPATH . '/header.php');
else else
require_once( ABSPATH . 'wp-includes/wp-header.php'); load_template( ABSPATH . 'wp-includes/wp-header.php');
} }
function get_footer() { function get_footer() {
global $wpdb, $wp_query;
if ( file_exists( TEMPLATEPATH . '/footer.php') ) if ( file_exists( TEMPLATEPATH . '/footer.php') )
require_once( TEMPLATEPATH . '/footer.php'); load_template( TEMPLATEPATH . '/footer.php');
else else
require_once( ABSPATH . 'wp-includes/wp-footer.php'); load_template( ABSPATH . 'wp-includes/wp-footer.php');
} }
function get_sidebar() { function get_sidebar() {
global $wpdb, $wp_query;
if ( file_exists( TEMPLATEPATH . '/sidebar.php') ) if ( file_exists( TEMPLATEPATH . '/sidebar.php') )
require_once( TEMPLATEPATH . '/sidebar.php'); load_template( TEMPLATEPATH . '/sidebar.php');
else else
require_once( ABSPATH . 'wp-includes/wp-sidebar.php'); load_template( ABSPATH . 'wp-includes/wp-sidebar.php');
} }