Changeset 2038
- Timestamp:
- 01/03/2005 12:14:42 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-blog-header.php
r1972 r2038 7 7 require_once( dirname(__FILE__) . '/wp-config.php'); 8 8 9 require_once( dirname(__FILE__). '/wp-includes/wp-l10n.php');9 require_once( ABSPATH . '/wp-includes/wp-l10n.php'); 10 10 11 11 $query_vars = array(); … … 104 104 } 105 105 106 if ('' != $feed) { 107 $doing_rss = true; 108 } 109 110 if (is_trackback()) { 111 $doing_trackback = true; 112 } 106 if ( '' != $feed ) 107 $doing_rss = true; 108 109 110 if ( is_trackback() ) 111 $doing_trackback = true; 113 112 114 113 // Sending HTTP headers 115 114 116 if ( is_404()) {117 header( "HTTP/1.x 404 Not Found");115 if ( is_404() ) { 116 header('HTTP/1.x 404 Not Found'); 118 117 } else if ( !isset($doing_rss) || !$doing_rss ) { 119 @header 118 @header('X-Pingback: '. get_bloginfo('pingback_url')); 120 119 } else { 121 120 // We're showing a feed, so WP is indeed the only thing that last changed … … 127 126 @header("Last-Modified: $wp_last_modified"); 128 127 @header("ETag: $wp_etag"); 129 @header 128 @header('X-Pingback: ' . get_bloginfo('pingback_url')); 130 129 131 130 // Support for Conditional GET … … 143 142 exit; 144 143 } else { 145 if ( version_compare(phpversion(),'4.3.0','>=')) {144 if ( version_compare(phpversion(), '4.3.0', '>=') ) { 146 145 header('Not Modified', TRUE, 304); 147 146 } else { … … 197 196 (false === strpos($_SERVER['REQUEST_URI'], '?')) ) { 198 197 $wp_query->is_404 = true; 199 header( "HTTP/1.x 404 Not Found");198 header('HTTP/1.x 404 Not Found'); 200 199 } 201 200 … … 207 206 // Template redirection 208 207 if ($pagenow == 'index.php') { 209 if ( ! isset($wp_did_template_redirect)) {208 if ( !isset($wp_did_template_redirect) ) { 210 209 $wp_did_template_redirect = true; 211 210 do_action('template_redirect', ''); 212 if (is_feed()) { 213 include(dirname(__FILE__) . '/wp-feed.php'); 214 exit; 215 } else if (is_trackback()) { 216 include(dirname(__FILE__) . '/wp-trackback.php'); 217 exit; 218 } else if (is_404() && 219 file_exists("$wp_template_dir/404.php")) { 211 if ( is_feed() ) { 212 include(ABSPATH . '/wp-feed.php'); 213 exit; 214 } else if ( is_trackback() ) { 215 include(ABSPATH . '/wp-trackback.php'); 216 exit; 217 } else if ( is_404() && file_exists("$wp_template_dir/404.php") ) { 220 218 include("$wp_template_dir/404.php"); 221 219 exit; 222 } else if (is_home() && 223 file_exists("$wp_template_dir/index.php")) { 220 } else if ( is_home() && file_exists("$wp_template_dir/index.php") ) { 224 221 include("$wp_template_dir/index.php"); 225 222 exit; 226 } else if (is_single() && 227 file_exists("$wp_template_dir/single.php")) { 223 } else if ( is_single() && file_exists("$wp_template_dir/single.php") ) { 228 224 include("$wp_template_dir/single.php"); 229 225 exit; 230 } else if ( is_page() && file_exists(get_page_template())) {226 } else if ( is_page() && file_exists(get_page_template()) ) { 231 227 include(get_page_template()); 232 228 exit; 233 } else if (is_category() && 234 file_exists("$wp_template_dir/category.php")) { 229 } else if ( is_category() && file_exists("$wp_template_dir/category-" . get_query_var('cat') . '.php') ) { 230 include("$wp_template_dir/category" . get_query_var('cat') . '.php'); 231 exit; 232 } else if ( is_category() && file_exists("$wp_template_dir/category.php") ) { 235 233 include("$wp_template_dir/category.php"); 236 234 exit; 237 } else if (is_author() && 238 file_exists("$wp_template_dir/author.php")) { 235 } else if ( is_author() && file_exists("$wp_template_dir/author.php") ) { 239 236 include("$wp_template_dir/author.php"); 240 237 exit; 241 } else if (is_date() && 242 file_exists("$wp_template_dir/date.php")) { 238 } else if ( is_date() && file_exists("$wp_template_dir/date.php") ) { 243 239 include("$wp_template_dir/date.php"); 244 240 exit; 245 } else if (is_archive() && 246 file_exists("$wp_template_dir/archive.php")) { 241 } else if ( is_archive() && file_exists("$wp_template_dir/archive.php") ) { 247 242 include("$wp_template_dir/archive.php"); 248 243 exit; 249 } else if (is_search() && 250 file_exists("$wp_template_dir/search.php")) { 244 } else if ( is_search() && file_exists("$wp_template_dir/search.php") ) { 251 245 include("$wp_template_dir/search.php"); 252 246 exit; 253 } else if (is_paged() && 254 file_exists("$wp_template_dir/paged.php")) { 247 } else if ( is_paged() && file_exists("$wp_template_dir/paged.php") ) { 255 248 include("$wp_template_dir/paged.php"); 256 249 exit; 257 } else if (file_exists("$wp_template_dir/index.php")) 258 { 259 include("$wp_template_dir/index.php"); 260 exit; 261 } 250 } else if ( file_exists("$wp_template_dir/index.php") ) { 251 include("$wp_template_dir/index.php"); 252 exit; 253 } 262 254 } 263 255 }
Note: See TracChangeset
for help on using the changeset viewer.