WordPress.org

Make WordPress Core

Changeset 14276


Ignore:
Timestamp:
04/28/2010 07:48:09 AM (9 years ago)
Author:
westi
Message:

Introduce a template file for the Front Page of a site. Has priority over every other template which applies and falls back to the standard template flow for the page / list of posts.
Fixes #6801

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-loader.php

    r13819 r14276  
    2424    elseif ( is_search()         && $template = get_search_template()         ) :
    2525    elseif ( is_tax()            && $template = get_taxonomy_template()       ) :
     26    elseif ( is_front_page()     && $template = get_front_page_template()     ) :
    2627    elseif ( is_home()           && $template = get_home_template()           ) :
    2728    elseif ( is_attachment()     && $template = get_attachment_template()     ) :
  • trunk/wp-includes/theme.php

    r14240 r14276  
    845845/**
    846846 * Retrieve path of home template in current or parent template.
    847  *
     847 *
     848 * This is the template used for the page containing the blog posts
     849 *
    848850 * Attempts to locate 'home.php' first before falling back to 'index.php'.
    849851 *
     
    856858    $template = locate_template(array('home.php', 'index.php'));
    857859    return apply_filters('home_template', $template);
     860}
     861
     862/**
     863 * Retrieve path of front-page template in current or parent template.
     864 *
     865 * Looks for 'front-page.php'.
     866 *
     867 * @since 3.0.0
     868 * @uses apply_filters() Calls 'front_page_template' on file path of template.
     869 *
     870 * @return string
     871 */
     872function get_front_page_template() {
     873    global $wp_query;
     874
     875    return apply_filters( 'front_page_template', locate_template( array('front-page.php') ) );
    858876}
    859877
     
    10021020    $located = '';
    10031021    foreach ( $template_names as $template_name ) {
     1022        if ( !$template_name )
     1023            continue;
    10041024        if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
    10051025            $located = STYLESHEETPATH . '/' . $template_name;
Note: See TracChangeset for help on using the changeset viewer.