Fix page-<pageslug>.php templates for static front pages. See #12907

git-svn-id: http://svn.automattic.com/wordpress/trunk@14152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-04-18 11:50:48 +00:00
parent f7e764312b
commit 66a9d58336
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 = '';