WordPress.org

Make WordPress Core

Ticket #6801: 6801-alternative-ordering.diff

File 6801-alternative-ordering.diff, 2.0 KB (added by westi, 8 years ago)

My proposal

  • wp-includes/template-loader.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-trunk
     
    2323        } else if ( is_tax() && $template = get_taxonomy_template()) {
    2424                include($template);
    2525                return;
     26        } else if ( is_front_page() && $template = get_front_page_template() ) {
     27                include($template);
     28                return;
    2629        } else if ( is_home() && $template = get_home_template() ) {
    2730                include($template);
    2831                return;
     
    7578        }
    7679}
    7780
    78 ?>
    79  No newline at end of file
     81?>
  • wp-includes/theme.php

     
    829829}
    830830
    831831/**
     832 * Retrieve path of front-page template in current or parent template.
     833 *
     834 * First attempt is to look for a page specific template either based on
     835 * the '_wp_page_template' page meta, the page slug and the page id.
     836 * The second attempt is to look for 'front-page.php' before falling back
     837 * to 'page.php' and ultimately falling back to 'index.php' if none of
     838 * these exist.
     839 *
     840 * @since 3.0.0
     841 * @uses apply_filters() Calls 'front_page_template' on file path of template.
     842 *
     843 * @return string
     844 */
     845function get_front_page_template() {
     846        global $wp_query;
     847
     848        $templates = array();
     849        $templates[] = "front-page.php";
     850
     851        // If we are showing a page on the front give priority to the page specific templates.
     852        if ( 'page' == get_option('show_on_front') ) {
     853                $templates[] = basename(get_page_template());
     854        } else if ( 'posts' == get_option('show_on_front') ) {
     855                $templates[] = basename(get_home_template());
     856        }
     857
     858        return apply_filters('front_page_template', locate_template($templates));
     859}
     860
     861/**
    832862 * Retrieve path of page template in current or parent template.
    833863 *
    834864 * Will first look for the specifically assigned page template