Hey all first off im a WP newbie so go easy!
Ive been searching for a couple of days now to see if I can find the answer to this but cant get anything definitive.
I have a custom post type called 'documents' and a corresponding archive called archive-documents.php. When I click on a custom taxonomy it displays my custom posts in the default archive.php template.
Rather than trying to explain more here is the code in functions.php
add_action('init', 'documents_register');
function documents_register() {
$labels = array(
'name' => _x('Documents', 'post type general name'),
'singular_name' => _x('Document', 'post type singular name'),
'add_new' => _x('Add New', 'Document Entry'),
'add_new_item' => __('Add New Document Entry'),
'edit_item' => __('Edit Document Entry'),
'new_item' => __('New Document Entry'),
'view_item' => __('View Document Entry'),
'search_items' => __('Search Documents'),
'not_found' => __('Nothing found'),
'not_found_in_trash' => __('Nothing found in Trash'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'menu_icon' => get_stylesheet_directory_uri() . '/images/documents-icon.png',
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'rewrite' => array( 'slug' => 'documents' ),
'has_archive' => true,
'supports' => array('title','editor','thumbnail'),
);
register_post_type( 'documents' , $args );
register_taxonomy("types", array("documents"), array("hierarchical" => true, "label" => "Types", "singular_label" => "Type", "rewrite" => true));
}
