Wordpress 2.9-scripts
[autoinstalls/wordpress.git] / wp-includes / template-loader.php
index 0c5a671c87acb7441d2639f4014f554974b34053..9fd4ffe5171d860ea89aeff68b7886badcd20087 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() ) {
@@ -16,20 +20,20 @@ if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) {
        } else if ( is_search() && $template = get_search_template() ) {
                include($template);
                return;
+       } else if ( is_tax() && $template = get_taxonomy_template()) {
+               include($template);
+               return;
        } else if ( is_home() && $template = get_home_template() ) {
                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()) {
@@ -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;
        }