0
votes

I am trying to create a custom taxonomy page template in my wordpress theme, but it shows always archive.php though i created taxonomy-lesson_categories.php and also tried taxonomy-lesson-category.php But not of that working.

Here is my taxonomy function in functions.php :

function cv_themes_taxonomy() {  
    register_taxonomy(  
        'lesson_categories',  //The name of the taxonomy.  
        'cv',        //post type name
        array(  
            'hierarchical' => true,  
            'label' => 'Lesson Category',  //Display name
            'query_var' => true,
            'rewrite' => array(
                'slug' => 'lesson-category', 
                'with_front' => true 
            )
        )  
    );  
}  

add_action( 'init', 'cv_themes_taxonomy');

Note : There my post_type name is CV

Anyone know the reason?

2

2 Answers

1
votes

You will need to read the https://developer.wordpress.org/themes/template-files-section/taxonomy-templates/ taxonomy template article on WordPress.org for that information.

1
votes

// I am using following code in my functions.php file and saved permalinks again in admin to take effect. Yes its working fine . I tried it.:-

function cv_themes_taxonomy() {  
    register_taxonomy(  
        'lesson_categories',  //The name of the taxonomy.  
        'cv',        //post type name
        array(  
            'hierarchical' => true,  
            'label' => 'Lesson Category',  //Display name
            'query_var' => true,
            'rewrite' => array(
                'slug' => 'lesson-category', 
                'with_front' => true 
            )
        )  
    );  
}  

add_action( 'init', 'cv_themes_taxonomy');