get_singular_template

Retrieves the path of the singular template in current or parent template.

Description

(string) get_singular_template(); 

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

Returns (string)

Full path to singular template file


Usage

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

Defined (1)

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

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