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