+
+ // If we have two files of the same name prefer the one in the Template Directory
+ // This means that we display the correct files for child themes which overload Templates as well as Styles
+ if( array_key_exists($description, $template_mapping ) ) {
+ if ( false !== strpos( $template_file, $template_dir ) ) {
+ $template_mapping[ $description ] = array( $template_file, $filedesc );
+ }
+ } else {
+ $template_mapping[ $description ] = array( $template_file, $filedesc );
+ }
+ }
+ ksort( $template_mapping );
+ while ( list( $template_sorted_key, list( $template_file, $filedesc ) ) = each( $template_mapping ) ) :
+ ?>