Ticket #15513: use-page-template-for-home-page-if-exists.15513.diff

File use-page-template-for-home-page-if-exists.15513.diff, 522 bytes (added by filosofo, 2 years ago)
Line 
1Index: wp-includes/theme.php
2===================================================================
3--- wp-includes/theme.php       (revision 16497)
4+++ wp-includes/theme.php       (working copy)
5@@ -912,8 +912,12 @@
6  * @return string
7  */
8 function get_home_template() {
9+       $template = get_post_meta( get_queried_object_id(), '_wp_page_template', true);
10        $templates = array( 'home.php', 'index.php' );
11 
12+       if ( ! empty( $template ) )
13+               array_unshift( $templates, $template );
14+
15        return get_query_template( 'home', $templates );
16 }
17