WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/14/2010 10:39:47 AM (10 years ago)
Author:
nacin
Message:

Custom post type archives. see #13818.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r15771 r15803  
    782782 */
    783783function get_archive_template() {
    784     return get_query_template('archive');
     784    $post_type = get_query_var( 'post_type' );
     785
     786    $templates = array();
     787
     788    if ( $post_type )
     789        $templates[] = "archive-{$post_type}.php";
     790    $templates[] = 'archive.php';
     791
     792    return get_query_template( 'archive', $templates );
    785793}
    786794
Note: See TracChangeset for help on using the changeset viewer.