I have registered a custom taxonomy wfa_book_genres
through plugin and the slug name for this taxonomy is genres
.
Now i want to include archive template from plugin folder for my custom taxonomy. I tried to use below examples code but it shows completely blank when goes to that archive term. I don't know how to solve this issue. I am really stuck here:
add_filter('template_include', 'wfa_taxonomy_template');
function wfa_taxonomy_template( $template ){
/*
// if wfa_book_genres taxonomy
if( is_tax('wfa_book_genres')){
$template = plugin_dir_url(__FILE__ ).'taxonomy-wfa_book_genres.php';
}
*/
// if wfa_book_genres taxonomy slug
if( is_tax('genres')){
$template = plugin_dir_url(__FILE__ ).'taxonomy-wfa_book_genres.php';
}
return $template;
}