Ticket #6801: 6801.006.diff
| File 6801.006.diff, 2.4 KB (added by , 17 years ago) |
|---|
-
trunk/wp-includes/template-loader.php
26 26 } else if ( is_home() && $template = get_home_template() ) { 27 27 include($template); 28 28 return; 29 } else if ( is_front_page() && $template = get_front_page_template() ) { 30 include($template); 31 return; 29 32 } else if ( is_attachment() && $template = get_attachment_template() ) { 30 33 remove_filter('the_content', 'prepend_attachment'); 31 34 include($template); … … 75 78 } 76 79 } 77 80 78 ?> 79 No newline at end of file 81 ?> -
trunk/wp-includes/theme.php
667 667 /** 668 668 * Retrieve path of home template in current or parent template. 669 669 * 670 * Attempts to locate 'home.php' first before falling back to 'index.php'.670 * Attempts to locate 'home.php'. 671 671 * 672 672 * @since 1.5.0 673 673 * @uses apply_filters() Calls 'home_template' on file path of home template. … … 675 675 * @return string 676 676 */ 677 677 function get_home_template() { 678 $template = locate_template(array('home.php' , 'index.php'));678 $template = locate_template(array('home.php')); 679 679 return apply_filters('home_template', $template); 680 680 } 681 681 682 682 /** 683 * Retrieve path of front-page template in current or parent template. 684 * 685 * First attempt is to look for the file in the '_wp_page_template' page meta 686 * data. The second attempt, if the first does not have a file or it's empty, is 687 * to look for 'front-page.php' before falling back to 'page.php'. 688 * 689 * @since 2.9.0 690 * @uses apply_filters() Calls 'front_page_template' on file path of template. 691 * 692 * @return string 693 */ 694 function get_front_page_template() { 695 global $wp_query; 696 697 $id = (int) $wp_query->post->ID; 698 $template = get_post_meta($id, '_wp_page_template', true); 699 700 if ( 'default' == $template ) 701 $template = ''; 702 703 $templates = array(); 704 if ( !empty($template) && !validate_file($template) ) 705 $templates[] = $template; 706 707 $templates[] = "front-page.php"; 708 $templates[] = "page.php"; 709 710 return apply_filters('front_page_template', locate_template($templates)); 711 } 712 713 /** 683 714 * Retrieve path of page template in current or parent template. 684 715 * 685 716 * First attempt is to look for the file in the '_wp_page_template' page meta