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:
Dion Hulse 2010-04-18 11:50:48 +00:00
parent a897bc0275
commit 122abf2fa8
1 changed files with 6 additions and 0 deletions

View File

@ -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 = '';