0
votes

I have a category-style custom taxonomy called 'ctc_sermon_topic' with the slug 'sermon-topic'.

I can reach archives/sermon-topic/contentment and I see that it uses my template file called: taxonomy-ctc_sermon_topic.php

But I want to include a page for all terms in the taxonomy. The idea is that from this page a user could navigate to any of the terms in the taxonomy (like archives/sermon-topic/contentment).

I've tried creating template files called ctc_sermon_topic.php and archive_ctc_sermon_topic.php but can't see them used anywhere. And navigating to archives/sermon-topic /sermon-topic result in 404 not found.

$args = array(
    'labels' => array(
        'name'                          => esc_html_x( 'Sermon Topics', 'taxonomy general name', 'church-theme-content' ),
        'singular_name'                 => esc_html_x( 'Sermon Topic', 'taxonomy singular name', 'church-theme-content' ),
        'search_items'                  => esc_html_x( 'Search Topics', 'sermons', 'church-theme-content' ),
        'popular_items'                 => esc_html_x( 'Popular Topics', 'sermons', 'church-theme-content' ),
        'all_items'                     => esc_html_x( 'All Topics', 'sermons', 'church-theme-content' ),
        'parent_item'                   => null,
        'parent_item_colon'             => null,
        'edit_item'                     => esc_html_x( 'Edit Topic', 'sermons', 'church-theme-content' ),
        'update_item'                   => esc_html_x( 'Update Topic', 'sermons', 'church-theme-content' ),
        'add_new_item'                  => esc_html_x( 'Add Topic', 'sermons', 'church-theme-content' ),
        'new_item_name'                 => esc_html_x( 'New Topic', 'sermons', 'church-theme-content' ),
        'separate_items_with_commas'    => esc_html_x( 'Separate topics with commas', 'sermons', 'church-theme-content' ),
        'add_or_remove_items'           => esc_html_x( 'Add or remove topics', 'sermons', 'church-theme-content' ),
        'choose_from_most_used'         => esc_html_x( 'Choose from the most used topics', 'sermons', 'church-theme-content' ),
        'menu_name'                     => esc_html_x( 'Topics', 'sermon menu name', 'church-theme-content' )
    ),
    'hierarchical'  => true, // category-style instead of tag-style
    'public'        => ctc_taxonomy_supported( 'sermons', 'ctc_sermon_topic' ),
    'rewrite'       => array(
        'slug'          => 'sermon-topic',
        'with_front'    => true,
        'hierarchical'  => true
    )
);
1

1 Answers

0
votes

For a single term, what you need is to create a file named taxonomy-sermon-topic.php.

For more information, take a look at the Template Hierarchy: https://developer.wordpress.org/themes/basics/template-hierarchy/

If you need a listing of all terms that exists in the taxonomy sermon-topic, you will have to create a custom page template with the slug (/sermon-topic) that will loop through the list of terms. By default, WordPress does not support any archive page like post objects.