get_search_template

Retrieve path of search template in current or parent template.

Description

(string) get_search_template(); 

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

Returns (string)

Full path to search template file.


Usage

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

Defined (1)

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

/wp-includes/template.php  
  1. function get_search_template() { 
  2. return get_query_template('search');