| 1 | <?php | 
|---|
| 2 | if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) { | 
|---|
| 3 |         do_action('template_redirect'); | 
|---|
| 4 |         if ( is_feed() ) { | 
|---|
| 5 |                 include(ABSPATH . '/wp-feed.php'); | 
|---|
| 6 |                 return; | 
|---|
| 7 |         } else if ( is_trackback() ) { | 
|---|
| 8 |                 include(ABSPATH . '/wp-trackback.php'); | 
|---|
| 9 |                 return; | 
|---|
| 10 |         } else if ( is_404() && $template = get_404_template() ) { | 
|---|
| 11 |                 include($template); | 
|---|
| 12 |                 return; | 
|---|
| 13 |         } else if ( is_search() && $template = get_search_template() ) { | 
|---|
| 14 |                 include($template); | 
|---|
| 15 |                 return; | 
|---|
| 16 |         } else if ( is_home() && $template = get_home_template() ) { | 
|---|
| 17 |                 include($template); | 
|---|
| 18 |                 return; | 
|---|
| 19 |         } else if ( is_attachment() && $template = get_attachment_template() ) { | 
|---|
| 20 |                 include($template); | 
|---|
| 21 |                 return; | 
|---|
| 22 |         } else if ( is_single() && $template = get_single_template() ) { | 
|---|
| 23 |                 if ( is_attachment() ) | 
|---|
| 24 |                         add_filter('the_content', 'prepend_attachment'); | 
|---|
| 25 |                 include($template); | 
|---|
| 26 |                 return; | 
|---|
| 27 |         } else if ( is_page() && $template = get_page_template() ) { | 
|---|
| 28 |                 if ( is_attachment() ) | 
|---|
| 29 |                         add_filter('the_content', 'prepend_attachment'); | 
|---|
| 30 |                 include($template); | 
|---|
| 31 |                 return; | 
|---|
| 32 |         } else if ( is_category() && $template = get_category_template()) { | 
|---|
| 33 |                 include($template); | 
|---|
| 34 |                 return;          | 
|---|
| 35 |         } else if ( is_author() && $template = get_author_template() ) { | 
|---|
| 36 |                 include($template); | 
|---|
| 37 |                 return; | 
|---|
| 38 |         } else if ( is_date() && $template = get_date_template() ) { | 
|---|
| 39 |                 include($template); | 
|---|
| 40 |                 return; | 
|---|
| 41 |         } else if ( is_archive() && $template = get_archive_template() ) { | 
|---|
| 42 |                 include($template); | 
|---|
| 43 |                 return; | 
|---|
| 44 |         } else if ( is_comments_popup() && $template = get_comments_popup_template() ) { | 
|---|
| 45 |                 include($template); | 
|---|
| 46 |                 return; | 
|---|
| 47 |         } else if ( is_paged() && $template = get_paged_template() ) { | 
|---|
| 48 |                 include($template); | 
|---|
| 49 |                 return; | 
|---|
| 50 |         } else if ( file_exists(TEMPLATEPATH . "/index.php") ) { | 
|---|
| 51 |                 if ( is_attachment() ) | 
|---|
| 52 |                         add_filter('the_content', 'prepend_attachment'); | 
|---|
| 53 |                 include(TEMPLATEPATH . "/index.php"); | 
|---|
| 54 |                 return; | 
|---|
| 55 |         } | 
|---|
| 56 | } else { | 
|---|
| 57 |         // Process feeds and trackbacks even if not using themes. | 
|---|
| 58 |         if ( is_feed() ) { | 
|---|
| 59 |                 include(ABSPATH . '/wp-feed.php'); | 
|---|
| 60 |                 return; | 
|---|
| 61 |         } else if ( is_trackback() ) { | 
|---|
| 62 |                 include(ABSPATH . '/wp-trackback.php'); | 
|---|
| 63 |                 return; | 
|---|
| 64 |         } | 
|---|
| 65 | } | 
|---|
| 66 |  | 
|---|
| 67 | ?> | 
|---|