]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/template-loader.php
Wordpress 2.5.1
[autoinstalls/wordpress.git] / wp-includes / template-loader.php
index 0c5a671c87acb7441d2639f4014f554974b34053..e2a24f204fcfa6d1b9c5e05f965f7449e0c5f234 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+/**
+ * Loads the correct template based on the visitor's url
+ * @package WordPress
+ */
 if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) {
        do_action('template_redirect');
        if ( is_robots() ) {
@@ -20,16 +24,13 @@ if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) {
                include($template);
                return;
        } else if ( is_attachment() && $template = get_attachment_template() ) {
+               remove_filter('the_content', 'prepend_attachment');
                include($template);
                return;
        } else if ( is_single() && $template = get_single_template() ) {
-               if ( is_attachment() )
-                       add_filter('the_content', 'prepend_attachment');
                include($template);
                return;
        } else if ( is_page() && $template = get_page_template() ) {
-               if ( is_attachment() )
-                       add_filter('the_content', 'prepend_attachment');
                include($template);
                return;
        } else if ( is_category() && $template = get_category_template()) {
@@ -38,6 +39,9 @@ if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) {
        } else if ( is_tag() && $template = get_tag_template()) {
                include($template);
                return;
+       } else if ( is_tax() && $template = get_taxonomy_template()) {
+               include($template);
+               return;
        } else if ( is_author() && $template = get_author_template() ) {
                include($template);
                return;
@@ -54,8 +58,6 @@ if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) {
                include($template);
                return;
        } else if ( file_exists(TEMPLATEPATH . "/index.php") ) {
-               if ( is_attachment() )
-                       add_filter('the_content', 'prepend_attachment');
                include(TEMPLATEPATH . "/index.php");
                return;
        }