summaryrefslogtreecommitdiffstats
path: root/wp-includes/template-loader.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/template-loader.php')
-rw-r--r--wp-includes/template-loader.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/wp-includes/template-loader.php b/wp-includes/template-loader.php
index cc218e7..eb44f68 100644
--- a/wp-includes/template-loader.php
+++ b/wp-includes/template-loader.php
@@ -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;
}