Fix page-<pageslug>.php templates for static front pages. See #12907
git-svn-id: https://develop.svn.wordpress.org/trunk@14152 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a897bc0275
commit
122abf2fa8
|
@ -875,6 +875,12 @@ function get_page_template() {
|
|||
$template = get_post_meta($id, '_wp_page_template', true);
|
||||
$pagename = get_query_var('pagename');
|
||||
|
||||
if ( !$pagename && $id > 0 ) {
|
||||
// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
|
||||
$post = $wp_query->get_queried_object();
|
||||
$pagename = $post->post_name;
|
||||
}
|
||||
|
||||
if ( 'default' == $template )
|
||||
$template = '';
|
||||
|
||||
|
|
Loading…
Reference in New Issue