]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/template.php
WordPress 3.5.1
[autoinstalls/wordpress.git] / wp-includes / template.php
index d86a677fb604d66bbc9cd508c1e95f613a9fe963..99d004687b66155336d935c630ed5c66dbe5d3fd 100644 (file)
@@ -59,12 +59,14 @@ function get_404_template() {
  * @return string
  */
 function get_archive_template() {
-       $post_types = get_query_var( 'post_type' );
+       $post_types = array_filter( (array) get_query_var( 'post_type' ) );
 
        $templates = array();
 
-       foreach ( (array) $post_types as $post_type )
+       if ( count( $post_types ) == 1 ) {
+               $post_type = reset( $post_types );
                $templates[] = "archive-{$post_type}.php";
+       }
        $templates[] = 'archive.php';
 
        return get_query_template( 'archive', $templates );