WordPress.org

Make WordPress Core

Changeset 14152


Ignore:
Timestamp:
04/18/2010 11:50:48 AM (8 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r14075 r14152  
    876876    $pagename = get_query_var('pagename');
    877877
     878    if ( !$pagename && $id > 0 ) {
     879        // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
     880        $post = $wp_query->get_queried_object();
     881        $pagename = $post->post_name;
     882    }
     883
    878884    if ( 'default' == $template )
    879885        $template = '';
Note: See TracChangeset for help on using the changeset viewer.