Use load_template().
git-svn-id: http://svn.automattic.com/wordpress/trunk@2023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
964011e54f
commit
5f0a8d8186
|
@ -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) {
|
||||||
|
|
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue