| 192 | | if ($pagenow == 'index.php') { |
|---|
| 193 | | if ( isset($wp_template_redirect) && $wp_template_redirect != true) { |
|---|
| 194 | | // If $wp_template_redirect is set to false, template redirection |
|---|
| 195 | | // should be skipped for everything except feeds and trackbacks. |
|---|
| 196 | | $wp_template_redirect = true; |
|---|
| 197 | | if ( is_feed() && empty($doing_rss) ) { |
|---|
| 198 | | include(ABSPATH . '/wp-feed.php'); |
|---|
| 199 | | exit; |
|---|
| 200 | | } else if ( is_trackback() ) { |
|---|
| 201 | | include(ABSPATH . '/wp-trackback.php'); |
|---|
| 202 | | exit; |
|---|
| 203 | | } |
|---|
| 204 | | } elseif ( !isset($wp_template_redirect) ) { |
|---|
| 205 | | $wp_template_redirect = true; |
|---|
| 206 | | do_action('template_redirect'); |
|---|
| 207 | | if ( is_feed() && empty($doing_rss) ) { |
|---|
| 208 | | include(ABSPATH . '/wp-feed.php'); |
|---|
| 209 | | exit; |
|---|
| 210 | | } else if ( is_trackback() ) { |
|---|
| 211 | | include(ABSPATH . '/wp-trackback.php'); |
|---|
| 212 | | exit; |
|---|
| 213 | | } else if ( is_404() && get_404_template() ) { |
|---|
| 214 | | include(get_404_template()); |
|---|
| 215 | | exit; |
|---|
| 216 | | } else if ( is_search() && get_search_template() ) { |
|---|
| 217 | | include(get_search_template()); |
|---|
| 218 | | exit; |
|---|
| 219 | | } else if ( is_home() && get_home_template() ) { |
|---|
| 220 | | include(get_home_template()); |
|---|
| 221 | | exit; |
|---|
| 222 | | } else if ( is_single() && get_single_template() ) { |
|---|
| 223 | | include(get_single_template()); |
|---|
| 224 | | exit; |
|---|
| 225 | | } else if ( is_page() && get_page_template() ) { |
|---|
| 226 | | include(get_page_template()); |
|---|
| 227 | | exit; |
|---|
| 228 | | } else if ( is_category() && get_category_template()) { |
|---|
| 229 | | include(get_category_template()); |
|---|
| 230 | | exit; |
|---|
| 231 | | } else if ( is_author() && get_author_template() ) { |
|---|
| 232 | | include(get_author_template()); |
|---|
| 233 | | exit; |
|---|
| 234 | | } else if ( is_date() && get_date_template() ) { |
|---|
| 235 | | include(get_date_template()); |
|---|
| 236 | | exit; |
|---|
| 237 | | } else if ( is_archive() && get_archive_template() ) { |
|---|
| 238 | | include(get_archive_template()); |
|---|
| 239 | | exit; |
|---|
| 240 | | } else if ( is_paged() && get_paged_template() ) { |
|---|
| 241 | | include(get_paged_template()); |
|---|
| 242 | | exit; |
|---|
| 243 | | } else if ( file_exists(TEMPLATEPATH . "/index.php") ) { |
|---|
| 244 | | include(TEMPLATEPATH . "/index.php"); |
|---|
| 245 | | exit; |
|---|
| 246 | | } |
|---|
| | 192 | if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) { |
|---|
| | 193 | do_action('template_redirect'); |
|---|
| | 194 | if ( is_feed() && empty($doing_rss) ) { |
|---|
| | 195 | include(ABSPATH . '/wp-feed.php'); |
|---|
| | 196 | exit; |
|---|
| | 197 | } else if ( is_trackback() ) { |
|---|
| | 198 | include(ABSPATH . '/wp-trackback.php'); |
|---|
| | 199 | exit; |
|---|
| | 200 | } |
|---|
| | 201 | if ( is_feed() && empty($doing_rss) ) { |
|---|
| | 202 | include(ABSPATH . '/wp-feed.php'); |
|---|
| | 203 | exit; |
|---|
| | 204 | } else if ( is_trackback() ) { |
|---|
| | 205 | include(ABSPATH . '/wp-trackback.php'); |
|---|
| | 206 | exit; |
|---|
| | 207 | } else if ( is_404() && get_404_template() ) { |
|---|
| | 208 | include(get_404_template()); |
|---|
| | 209 | exit; |
|---|
| | 210 | } else if ( is_search() && get_search_template() ) { |
|---|
| | 211 | include(get_search_template()); |
|---|
| | 212 | exit; |
|---|
| | 213 | } else if ( is_home() && get_home_template() ) { |
|---|
| | 214 | include(get_home_template()); |
|---|
| | 215 | exit; |
|---|
| | 216 | } else if ( is_single() && get_single_template() ) { |
|---|
| | 217 | include(get_single_template()); |
|---|
| | 218 | exit; |
|---|
| | 219 | } else if ( is_page() && get_page_template() ) { |
|---|
| | 220 | include(get_page_template()); |
|---|
| | 221 | exit; |
|---|
| | 222 | } else if ( is_category() && get_category_template()) { |
|---|
| | 223 | include(get_category_template()); |
|---|
| | 224 | exit; |
|---|
| | 225 | } else if ( is_author() && get_author_template() ) { |
|---|
| | 226 | include(get_author_template()); |
|---|
| | 227 | exit; |
|---|
| | 228 | } else if ( is_date() && get_date_template() ) { |
|---|
| | 229 | include(get_date_template()); |
|---|
| | 230 | exit; |
|---|
| | 231 | } else if ( is_archive() && get_archive_template() ) { |
|---|
| | 232 | include(get_archive_template()); |
|---|
| | 233 | exit; |
|---|
| | 234 | } else if ( is_paged() && get_paged_template() ) { |
|---|
| | 235 | include(get_paged_template()); |
|---|
| | 236 | exit; |
|---|
| | 237 | } else if ( file_exists(TEMPLATEPATH . "/index.php") ) { |
|---|
| | 238 | include(TEMPLATEPATH . "/index.php"); |
|---|
| | 239 | exit; |
|---|