Displaying category archive of custom post types

You can force use of your template for categories with the category_template filter:

function wpa57439_category_template( $templates="" ){
    if( !is_array( $templates ) && !empty( $templates ) ) {
        $templates = locate_template( array( 'archive-actors.php', $templates ), false );
    } 
    elseif( empty( $templates ) ) {
        $templates = locate_template( 'archive-actors.php', false );
    }
    else {
        $new_template = locate_template( array( 'archive-actors.php' ) );
        if( !empty( $new_template ) ) array_unshift( $templates, $new_template );
    }
    return $templates;
}
add_filter( 'category_template', 'wpa57439_category_template' );

adapted from Filter Hierarchy in codex.

Leave a Comment

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