I have a custom post type that looks like:
register_post_type( 'letters', array(
'labels' => array(
'all_items' => __( 'All Letters', 'text_domain' ),
'name' => __( 'Letters' ),
'search_items' => __('Search Letters'),
'singular_name' => __( 'Letter' ),
),
'has_archive' => true,
'menu_icon' => 'dashicons-media-document',
'menu_position'=> 5,
'public' => true,
'rewrite' => array('slug' => 'letters'),
'supports' => array( 'title', 'editor', 'author' ),
)
);
Then, I have a custom taxonomy that looks like:
function create_letter_taxonomies() {
$labels = array(
'add_new_item' => __( 'Add New Tag' ),
'add_or_remove_items' => __( 'Add or remove tags' ),
'all_items' => __( 'All Tags' ),
'choose_from_most_used' => __( 'Choose from the most used tags' ),
'edit_item' => __( 'Edit Tag' ),
'menu_name' => __( 'Tags' ),
'name' => _x( 'Tags', 'tag' ),
'new_item_name' => __( 'New Tag Name' ),
'parent_item' => null,
'parent_item_colon' => null,
'popular_items' => __( 'Popular Tags' ),
'search_items' => __( 'Search Tags' ),
'separate_items_with_commas' => __( 'Separate tags with commas' ),
'singular_name' => _x( 'Tag', 'tag' ),
'update_item' => __( 'Update Tag' ),
);
register_taxonomy('letter_tags','letters', array(
'hierarchical' => false,
'labels' => $labels,
'query_var' => true,
'rewrite' => array( 'slug' => 'tags' ),
'show_admin_column' => true,
'show_ui' => true,
'update_count_callback' => '_update_post_term_count',
)
);
}
What I am struggling with is how the taxonomy is working with my template. Through the admin panel I can add tags for my custom post type. http://joshrodg.com/hallmark/letters/ works but http://joshrodg.com/hallmark/letters/tags/moore/ doesn't work and http://joshrodg.com/hallmark/letters/tags/kenya/ doesn't work.
The archive page I have is: taxonomy-letter_tags.php
...am I missing something? I am trying to understand why I'm getting a 404 instead of seeing the taxonomy-letter_tags.php
template?
Thanks,
Josh