get_home_template

Retrieve path of home template in current or parent template.

Description

(string) get_home_template(); 

The template hierarchy is filterable via the hook. The template path is filterable via the hook.

Returns (string)

Full path to home template file.


Usage

  1. if ( !function_exists( 'get_home_template' ) ) { 
  2. require_once ABSPATH . WPINC . '/template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_home_template(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/template.php  
  1. function get_home_template() { 
  2. $templates = array( 'home.php', 'index.php' ); 
  3.  
  4. return get_query_template( 'home', $templates );