Twenty Fourteen theme and the page-templates folder

The actual query for a Theme’s page templates happens in wp_get_theme()->get_page_templates() (source), which in turn calls get_files() (source).

The magic happens here:

$files = (array) $this->get_files( 'php', 1 );

The args for get_files() are:

function get_files( $type = null, $depth = 0, $search_parent = false ) {}

So, when WordPress searches the Theme for PHP files, it passes a $depth argument of 1, which means that it searches in subdirectories of the Theme root directory.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)