Permalink
Browse files

Better default behaviour for theme calling

git-svn-id: http://svn.automattic.com/wordpress/trunk@2303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
saxmatt
saxmatt committed Feb 13, 2005
1 parent 9c4632e commit ad536c567eb8ebd48ff98cfc0bd30939b214bc5d
Showing with 50 additions and 56 deletions.
  1. +2 −1 index.php
  2. +48 −55 wp-blog-header.php
View
@@ -1,4 +1,5 @@
<?php
-/* Don't remove this line. */
+/* Short and sweet */
+define('WP_USE_THEMES', true);
require('./wp-blog-header.php');
?>
View
@@ -189,61 +189,54 @@
$wp_template_dir = TEMPLATEPATH;
// Template redirection
-if ($pagenow == 'index.php') {
- if ( isset($wp_template_redirect) && $wp_template_redirect != true) {
- // If $wp_template_redirect is set to false, template redirection
- // should be skipped for everything except feeds and trackbacks.
- $wp_template_redirect = true;
- if ( is_feed() && empty($doing_rss) ) {
- include(ABSPATH . '/wp-feed.php');
- exit;
- } else if ( is_trackback() ) {
- include(ABSPATH . '/wp-trackback.php');
- exit;
- }
- } elseif ( !isset($wp_template_redirect) ) {
- $wp_template_redirect = true;
- do_action('template_redirect');
- if ( is_feed() && empty($doing_rss) ) {
- include(ABSPATH . '/wp-feed.php');
- exit;
- } else if ( is_trackback() ) {
- include(ABSPATH . '/wp-trackback.php');
- exit;
- } else if ( is_404() && get_404_template() ) {
- include(get_404_template());
- exit;
- } else if ( is_search() && get_search_template() ) {
- include(get_search_template());
- exit;
- } else if ( is_home() && get_home_template() ) {
- include(get_home_template());
- exit;
- } else if ( is_single() && get_single_template() ) {
- include(get_single_template());
- exit;
- } else if ( is_page() && get_page_template() ) {
- include(get_page_template());
- exit;
- } else if ( is_category() && get_category_template()) {
- include(get_category_template());
- exit;
- } else if ( is_author() && get_author_template() ) {
- include(get_author_template());
- exit;
- } else if ( is_date() && get_date_template() ) {
- include(get_date_template());
- exit;
- } else if ( is_archive() && get_archive_template() ) {
- include(get_archive_template());
- exit;
- } else if ( is_paged() && get_paged_template() ) {
- include(get_paged_template());
- exit;
- } else if ( file_exists(TEMPLATEPATH . "/index.php") ) {
- include(TEMPLATEPATH . "/index.php");
- exit;
- }
+if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) {
+ do_action('template_redirect');
+ if ( is_feed() && empty($doing_rss) ) {
+ include(ABSPATH . '/wp-feed.php');
+ exit;
+ } else if ( is_trackback() ) {
+ include(ABSPATH . '/wp-trackback.php');
+ exit;
+ }
+ if ( is_feed() && empty($doing_rss) ) {
+ include(ABSPATH . '/wp-feed.php');
+ exit;
+ } else if ( is_trackback() ) {
+ include(ABSPATH . '/wp-trackback.php');
+ exit;
+ } else if ( is_404() && get_404_template() ) {
+ include(get_404_template());
+ exit;
+ } else if ( is_search() && get_search_template() ) {
+ include(get_search_template());
+ exit;
+ } else if ( is_home() && get_home_template() ) {
+ include(get_home_template());
+ exit;
+ } else if ( is_single() && get_single_template() ) {
+ include(get_single_template());
+ exit;
+ } else if ( is_page() && get_page_template() ) {
+ include(get_page_template());
+ exit;
+ } else if ( is_category() && get_category_template()) {
+ include(get_category_template());
+ exit;
+ } else if ( is_author() && get_author_template() ) {
+ include(get_author_template());
+ exit;
+ } else if ( is_date() && get_date_template() ) {
+ include(get_date_template());
+ exit;
+ } else if ( is_archive() && get_archive_template() ) {
+ include(get_archive_template());
+ exit;
+ } else if ( is_paged() && get_paged_template() ) {
+ include(get_paged_template());
+ exit;
+ } else if ( file_exists(TEMPLATEPATH . "/index.php") ) {
+ include(TEMPLATEPATH . "/index.php");
+ exit;
}
}

0 comments on commit ad536c5

Please sign in to comment.