Advertisements

get_query_template

Definition:
function get_query_template( $type, $templates = array() {}

Retrieve path to a template
Used to quickly retrieve the path of a template without including the file extension. It will also check the parent theme, if the file exists, with the use of locate_template(). Allows for more generic template location without the use of the other get_*_template() functions.

Parameters

  • string $type: Filename without extension.
  • array $templates: An optional list of template candidates

Return values

returns:Full path to file.

Source code

function get_query_template( $type, $templates = array() ) {

	$type = preg_replace( '|[^a-z0-9-]+|', '', $type );



	if ( empty( $templates ) )

		$templates = array("{$type}.php");

1653

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: