| | 850 | * Retrieve path of front-page template in current or parent template. |
| | 851 | * |
| | 852 | * First attempt is to look for a page specific template either based on |
| | 853 | * the '_wp_page_template' page meta, the page slug and the page id. |
| | 854 | * The second attempt is to look for 'front-page.php' before falling back |
| | 855 | * to 'page.php' and ultimately falling back to 'index.php' if none of |
| | 856 | * these exist. |
| | 857 | * |
| | 858 | * @since 3.0.0 |
| | 859 | * @uses apply_filters() Calls 'front_page_template' on file path of template. |
| | 860 | * |
| | 861 | * @return string |
| | 862 | */ |
| | 863 | function get_front_page_template() { |
| | 864 | global $wp_query; |
| | 865 | |
| | 866 | $templates = array(); |
| | 867 | $templates[] = "front-page.php"; |
| | 868 | |
| | 869 | // If we are showing a page on the front give priority to the page specific templates. |
| | 870 | if ( 'page' == get_option('show_on_front') ) { |
| | 871 | $templates[] = basename(get_page_template()); |
| | 872 | } else if ( 'posts' == get_option('show_on_front') ) { |
| | 873 | $templates[] = basename(get_home_template()); |
| | 874 | } |
| | 875 | |
| | 876 | return apply_filters('front_page_template', locate_template($templates)); |
| | 877 | } |
| | 878 | |
| | 879 | /** |